Date Function Part 2

  • Thread starter Thread starter J R
  • Start date Start date
J

J R

Greetings,

I'm running the following function:

=IF(ISBLANK(L3),"",DATEDIF(C3,L3,"d"))

which works just fine...
....unless C3 is greater than L3. In this case the result turns out to be
"#NUM!".
L3 is usually filled with either =TODAY() or the date that an issue was
resolved, in a few instances it is blank.

How should I go about nesting IF statements (or should it be something
different like an OR statement?) so that DATEDIF(L3,C3,"d") will be produced
if C3 is set for sometime in the future?

TIA,
J.R.
 
Frank,

Again, thanks. I see the logic in your answer, but I can't get it to work.
I keep getting "#NUM!" as a response.

J.R.
 
Hi
easy one, I just messed the order. Try
=IF(ISBLANK(L3),"",DATEDIF(MIN(C3,L3),MAX(C3,L3),"d"))

Frank
 
The second argument must be larger than the first, that is why you get the
error,
I don't really understand your dilemma. Just make sure that the second date
is
greater than the first. What do you want it to do when you get a num error?

=IF(OR(L3="",L3<C3),"",DATEDIF(L3,C3,"d"))
 
A second thought, why do you use datedif to count days, you can just use

=L3-C3

It does make send if you would count years or month and days but hardly days
only?
 
Quite Right Peo,
Actually, I can't remember why that wasn't going to work for me when I
started this. But it seems to work fine this way now. Thank you.
J.R.
 
Back
Top