ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   =IF ..OR.. =IF (https://www.excelbanter.com/excel-programming/395644-%3Dif-%3Dif.html)

yovation

=IF ..OR.. =IF
 
Hi,

I'm trying to create a formula that will do this:

=IF(A1="G",print g,) or =IF(A1="J", print j,) =If(A1 = anything other
than 'G' or 'J', print 'ERROR")

Will someone help me with this. I am drawing a blank...

Thank you.
Yovation


PCLIVE

=IF ..OR.. =IF
 
I'm not sure about what you want with the 'print g' and 'print j' syntax,
but try this.

=IF(NOT(OR(A1={"G","J"})),"print ERROR",IF(A1="G","print g","print j"))

HTH,
Paul


--

"yovation" wrote in message
oups.com...
Hi,

I'm trying to create a formula that will do this:

=IF(A1="G",print g,) or =IF(A1="J", print j,) =If(A1 = anything other
than 'G' or 'J', print 'ERROR")

Will someone help me with this. I am drawing a blank...

Thank you.
Yovation




Brian Withun

=IF ..OR.. =IF
 
=IF(A1="G",g,IF(A1="J",j,"ERROR"))


this presupposes that g and j are defined to be something, otherwise
you'll just get a #NAME? error

Brian Herbert Withun


Trevor Shuttleworth

=IF ..OR.. =IF
 
Some options:

=IF(A1="G","G",IF(A1="J", "J","ERROR"))

=IF(A1="G",A1,IF(A1="J", A1,"ERROR"))

=IF(OR(A1="G",A1="J"), A1,"ERROR")

Regards

Trevor


"yovation" wrote in message
oups.com...
Hi,

I'm trying to create a formula that will do this:

=IF(A1="G",print g,) or =IF(A1="J", print j,) =If(A1 = anything other
than 'G' or 'J', print 'ERROR")

Will someone help me with this. I am drawing a blank...

Thank you.
Yovation




JE McGimpsey

=IF ..OR.. =IF
 
One way:

=IF(OR(EXACT(A1,{"G","J"})),LOWER(A1),"ERROR")

Or, if case doesn't matter:

=IF(OR(A1={"G","J"}),A1,"ERROR")

In article .com,
yovation wrote:

Hi,

I'm trying to create a formula that will do this:

=IF(A1="G",print g,) or =IF(A1="J", print j,) =If(A1 = anything other
than 'G' or 'J', print 'ERROR")

Will someone help me with this. I am drawing a blank...

Thank you.
Yovation


yovation

=IF ..OR.. =IF
 
Thank you.

=IF(A1="G","G",IF(A1="J", "J","ERROR"))

works great.

David


Trevor Shuttleworth

=IF ..OR.. =IF
 
You're welcome. Thanks for the feedback

Regards

Trevor


"yovation" wrote in message
ps.com...
Thank you.

=IF(A1="G","G",IF(A1="J", "J","ERROR"))

works great.

David




havocdragon

=IF ..OR.. =IF
 
=IF(A1="G","Print g",IF(A1="J","Print j","Print 'ERROR"))

"yovation" wrote:

Hi,

I'm trying to create a formula that will do this:

=IF(A1="G",print g,) or =IF(A1="J", print j,) =If(A1 = anything other
than 'G' or 'J', print 'ERROR")

Will someone help me with this. I am drawing a blank...

Thank you.
Yovation




All times are GMT +1. The time now is 03:37 PM.

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