Do not count if date not entered

[Solved/Closed]
Report
Posts
45
Registration date
Sunday February 7, 2010
Status
Member
Last seen
April 15, 2012
-
Posts
45
Registration date
Sunday February 7, 2010
Status
Member
Last seen
April 15, 2012
-
Hello,

I have a date in C3(30/06/2010) and sometimes a date in C4 (01/02/2010).In C5 i got a formula =((C3-C4)-I3)+1)*24. I3 will have the amount of days in C3 (30).
I want the formula in C5 to only work when a date is entered in C4. If no date in C4 there must be a zero/empty in C5.



3 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
try this

=IF(OR(C3="", C4="", C4=0), "" , (((C3-C4)-I3)+1)*24)

basically saying that if c3="" or c4= "" or c4=0, then show a ""
of all three conditions are false, then show the result of formula
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
4
Registration date
Wednesday July 28, 2010
Status
Member
Last seen
July 29, 2010

Rizvisa gave a much better solution below, this one could serve as an (less good!) alternative...

Not sure whether this is the best solution, but the way I solve this is by entering my formula in a cell of a column that I hide.

So in C5 I would then have: =IF(C4>0,H3,"") with H3 the cell in which I wrote the formula =((C3-C4)-I3)+1)*24

Hope this helps...
Posts
45
Registration date
Sunday February 7, 2010
Status
Member
Last seen
April 15, 2012

TX guys it helped me!