# Do not count if date not entered

Solved/Closed
Gouws Posts 45 Registration date Sunday February 7, 2010 Status Member Last seen April 15, 2012 - Jul 28, 2010 at 07:50 AM
Gouws Posts 45 Registration date Sunday February 7, 2010 Status Member Last seen April 15, 2012 - Aug 5, 2010 at 01:55 AM
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 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jul 28, 2010 at 09:29 AM
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
ellendms Posts 4 Registration date Wednesday July 28, 2010 Status Member Last seen July 29, 2010
Jul 28, 2010 at 08:28 AM
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...
Gouws Posts 45 Registration date Sunday February 7, 2010 Status Member Last seen April 15, 2012
Aug 5, 2010 at 01:55 AM
TX guys it helped me!