Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to show the Days between NOW() and the dates (dd/mm/yy) in either Column B or Column C - depending which one is not blank.

A         B         C
29/03/10            01/04/10
29/03/10  02/04/10
29/03/10            30/04/10
29/03/10  31/03/10
29/03/10  03/04/10

I currently have the formula below and then drag it down, but it obviously means I need to go back and correct the "errors."


I'm now using that instead of =DAYS360(). It gives me more accuracy (I think).

I always forget how to nest this type of null/blank thing, so any help or pointers to remember would be appreciated.

share|improve this question
up vote 5 down vote accepted

You can use an IF statement to achieve that as follows:


alt text

share|improve this answer
I've shifted away from my DAYS360 to MOD and ROUND. So using your formula structure it looks like: IF(ISBLANK(B2);ROUND(MOD(C2-A2,24),2);ROUND(MOD(B2-A2,24),2)). Unfortunately this gives me an error message. Any ideas? – RocketGoal Mar 29 '10 at 13:03
I think you should use comma instead of semicolon inside the formula. I have to use semicolon due to my regional settings. – Mehper C. Palavuzlar Mar 29 '10 at 13:13
Save some typing =DAYS360(A2;IF(ISBLANK(B2);C2;B2)) – Christopher Oezbek Mar 29 '10 at 14:14
Changing to comma did the trick - I should have known. – RocketGoal Mar 29 '10 at 14:22
Chris: Thanks I'd try your example as well, but I'm using ROUND and MOD now instead of DAYS360 - as I think it's more accurate for my needs. – RocketGoal Mar 29 '10 at 14:23

This is an old post, but this may be useful to other readers with a similar problem.

If there is always a date in either column B or column C and the other is always blank, you don't need an IF or an ISBLANK test:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .