Date Function Part 2

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.
 
J

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.
 
J

J R

Got it, Frank,

Just changed the MIN and MAX around...

Thanks much for your help today.

J.R.
 
F

Frank Kabel

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

Frank
 
P

Peo Sjoblom

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"))
 
P

Peo Sjoblom

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?
 
J

J R

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top