Solved

# Difference between two dates

Posted on 2011-03-21

Afternoon

I need to workout the difference between two dates. Although i have two twists to the calculation.

Always a Date (dd/mm/yyyy hh:mm:ss) in A1,

If there is a date in B1 (dd/mm/yyyy hh:mm:ss), then calculate the difference between the two.

If not then calculate the difference between Now() and A1.

This is the formula I have used and works.

IF(ISBLANK(A1),"",(IF(ISBLANK(B1),(NOW()-A1),(B1-A1))

Although I need to take into account to calculate only working days (mon-Fri) which I am afraid is beyond me.

It would be nice to have it stored in the VBA code although if it can only be done as a formula then it will do.

please could you assist in finding me a solution.

Thanks in advance.