Do not count if date not entered

Solved/Closed
Gouws Posts 45 Registration date Sunday 7 February 2010 Status Member Last seen 15 April 2012 - 28 Jul 2010 à 07:50
Gouws Posts 45 Registration date Sunday 7 February 2010 Status Member Last seen 15 April 2012 - 5 Aug 2010 à 01:55
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 28 January 2010 Status Contributor Last seen 5 May 2022 766
28 Jul 2010 à 09:29
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 28 July 2010 Status Member Last seen 29 July 2010
28 Jul 2010 à 08:28
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 7 February 2010 Status Member Last seen 15 April 2012
5 Aug 2010 à 01:55
TX guys it helped me!