If, And, Isnumber statement

D

dave roth

good morning;

I need to write a statement along the lines of :

=IF(AND(ISNUMBER(H2),H2<18),"Yes","No").

H2 contains the formula "=IF(A2<>"",DATEDIF(G$2:G$65536,A$2:A$65536,"y"),"")"

Obviously, Columns A and G contain dates, which are populated on an ongoing
basis, not a static set of dates. H2 will not have a number until A2 and G2
are populated.

The If, And, Isnumber formula returns Yes or No, but when I copy it down the
column to say, row 44 while the H column is blank, it returns "No"; what I
would like it to do is remain blank until H2 contains a number value.

XL 2007, Win Xp Pro.

Thank you very much for your assistance.
 
M

Mike H

Sorry I misunderstood, Try this instead

=IF(H2="","",IF(AND(ISNUMBER(H2),H2<18),"Yes","No"))

Mike
 
B

Bernard Liengme

=IF(H2="","", IF(AND(ISNUMBER(H2),H2<18),"Yes","No"))

But if the DATEDIF always gives a number and never an error value, you may
get away with
=IF(H2="","", IF(H2<18,"Yes","No"))


Is there a reason to use
=IF(A2<>"",DATEDIF(G$2:G$65536,A$2:A$65536,"y"),"")
rather than
=IF(A2<>"",DATEDIF(G2,A$2,"y"),"")"
Just curious!
best wishes
 
D

dave roth

No reason; the formula was imported from a previous year's spreadsheet, and
that's how it came in. I believe it was when we upgraded from XL 2003 to
2007.

the DATEDIF has been modified somewhat, because sometimes there is no date
value in A; just an entry of "Pending", so the formula knows to leave column
H blank.

Thanks.
 

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

Similar Threads


Top