> 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";"")).
Rick Rothstein (MVP - VB) - 16 May 2008 18:19 GMT
> 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
bokey - 16 May 2008 19:04 GMT
Both formulas worked Thank you for sharing.
> > Try this:
> >
[quoted text clipped - 7 lines]
>
> Rick
=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"))
> 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"

Signature
Dave Peterson