How to use the IsBlank Function with the DAYS function - Excel 365

Occasional Visitor

Hi,

 

I am just running a simple spreadsheet for collating my energy usage - see really simple!

 

 

But I just cannot get rid of the 0s and the date reference when one of the dates is blank, re attached excerpts...

 

 

I am trying to use this forumula, but it's not working; so can anyone help me please?

 

 

"=IF(OR(ISBLANK(A19),ISBLANK(A18)),"",(DAYS(A19,A18),0)"

 

 

Thank you.

2 Replies

@MaggieMoonlight There is a superfluous parenthesis.

Try

 

=IF(OR(ISBLANK(A19),ISBLANK(A18)),"",DAYS(A19,A18),0)

 

If A18 and/or A19 contain formulas, it's better to use

 

=IF(OR(A19="",A18=""),"",DAYS(A19,A18),0)