Saturday 16 November 2019

worksheet function - How can I write "use this cell or, if blank, use this other cell" in Excel 2007?


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."


=ROUND(MOD(C2-A2,24),2)

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.



Answer



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


=IF(ISBLANK(B2);DAYS360(A2;C2);DAYS360(A2;B2))

alt text


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...