#1   Report Post  
Posted to microsoft.public.excel.misc
hjm hjm is offline
external usenet poster
 
Posts: 12
Default 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!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default 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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
hjm hjm is offline
external usenet poster
 
Posts: 12
Default 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!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default 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!


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default 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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"