simple IF question

B

bokey

How do I write a formula that would evaluate a cell and return different
values?

IF cell = 1 or 2, return "A", if cell = 3, 4 or 5, return "B"
 
R

Ric0999

How do I write a formula that would evaluate a cell and return different
values?

IF cell = 1 or 2, return "A", if cell = 3, 4 or 5, return "B"

Try this:

=IF(OR(Cell=1;Cell=2);"A";IF(OR(Cell=3;Cell=4;Cell=5);"B";"")).
 
D

Dave Peterson

=if(or(a1={1,2}),"A",if(or(a1={3,4,5}),"B","not 1, 2, 3, 4, or 5"))

or

=if(or(a1=1,a1=2),"A",if(or(a1=3,a1=4,a1=5),"B","not 1, 2, 3, 4, or 5"))
 
R

Rick Rothstein \(MVP - VB\)

Try this:
=IF(OR(Cell=1;Cell=2);"A";IF(OR(Cell=3;Cell=4;Cell=5);"B";"")).

You can "tighten" that formula up some...

=IF(OR(Cell={1,2}),"A",IF(OR(Cell={3,4,5}),"B",""))

Note: My system uses commas (instead of semi-colons) as argument delimiters.

Rick
 
B

bokey

Both formulas worked Thank you for sharing.

Rick Rothstein (MVP - VB) said:
You can "tighten" that formula up some...

=IF(OR(Cell={1,2}),"A",IF(OR(Cell={3,4,5}),"B",""))

Note: My system uses commas (instead of semi-colons) as argument delimiters.

Rick
 
Top