Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default =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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default =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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default =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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default =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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default =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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default =IF ..OR.. =IF

Thank you.

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

works great.

David

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default =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



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default =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


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 03:25 PM.

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"