ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF Formula (https://www.excelbanter.com/excel-discussion-misc-queries/216135-if-formula.html)

hjm

IF Formula
 
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!


Pete_UK

IF Formula
 
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

On Jan 12, 12:18*pm, hjm wrote:
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!



Luke M

IF Formula
 
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"))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"hjm" wrote:

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!


Stefi

IF Formula
 
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:

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!


hjm

IF Formula
 
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 :-)

"Luke M" wrote:

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"))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"hjm" wrote:

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!



All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com