IF Formula

  • Thread starter Thread starter hjm
  • Start date Start date
H

hjm

Can the following be done?
If there is a date in column A, then return A otherwise if it is blank or
N/A look at column B & if there is a date there return col B.

Hope someone can help.

Thanks!
 
A date is just a number to Excel, so perhaps this:

=IF(ISNUMBER(A1),A1,IF(ISNUMBER(B1),B1, ""))

You didn't specify what you wanted if B does not contain a date.

Hope this helps.

Pete
 
Is it okay if it just checks to see if its a number? (since dates are
technically larger numbers). What happens if both column A and column B are
blank? Also, when you mention N/A, do you mean you enter "N/A" or the N/A
error is displayed?

Former
=IF(ISNUMBER(A2),A2,IF(AND(OR(ISBLANK(A2),A2="N/A"),ISNUMBER(B2)),B2,"Conditions not met"))
Latter
=IF(ISNUMBER(A2),A2,IF(AND(OR(ISBLANK(A2),ISNA(A2)),ISNUMBER(B2)),B2,"Conditions not met"))
 
Try something like this:
=IF(CELL("format",A1)="D4",A1,IF(CELL("format",B1)="D4",B1,"none of A1 and
B1 is a date!"))

But first have a look at CELL function and choose a date format which
returns one of D1-D5 codes, and adjust formula to your choice!

Regards,
Stefi

„hjm†ezt írta:
 
Hi Luke,

It is ok for it check it is a number. If both col's are blank, then it can
return blank. N/A is pulled through from the database automatically if this
part of the process isn't needed. Hope this helps a bit more :-)
 
Back
Top