=IF ..OR.. =IF

  • Thread starter Thread starter yovation
  • Start date Start date
Y

yovation

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
 
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
 
=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
 
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
 
One way:

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

Or, if case doesn't matter:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top