Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

simple IF question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bokey - 16 May 2008 17:53 GMT
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"
Ric0999 - 16 May 2008 18:03 GMT
> 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
Dave Peterson - 16 May 2008 18:11 GMT
=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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.