"OR" in Formula

B

Barb

I'm trying to create a formula that basically says:
IF a2 = BC or WWW, then insert the number 60, else if a2 = FR or FH, then
insert the number 120, else if a2 = SS or BS or PS or AS, then insert the
number 200.

This has me totally confused... I've done other similar calculations but
never using 'OR'.
 
J

Joe User

Barb said:
I'm trying to create a formula that basically says:
IF a2 = BC or WWW, then insert the number 60,
else if a2 = FR or FH, then insert the number 120,
else if a2 = SS or BS or PS or AS, then insert the
number 200.

If that exhausts all possible conditions, then:

=IF(OR(A2={"BC","WWW"}),60,
IF(OR(A2={"FR","FH"}),120,200))

Alternatively:

=LOOKUP(A2,
{"BC","WWW","FR","FH","SS","BS","PS","AS"},
{60,60,120,120,200,200,200,200})

But if there are other possibilities that you neglect to cover, then:

=IF(OR(A2={"BC","WWW"}),60,
IF(OR(A2={"FR","FH"}),120,
IF(OR(A2={"SS","BS","PS","AS"}),200,"")))


----- original message -----
 
M

Mike H

Hi,

try this

=IF(OR(A2="BC",A2="WWW"),60,IF(OR(A2="fr",A2="fh"),120,IF(OR(A2="SS",A2="PS",A2="AS"),200,"")))

all in 1 line
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
F

Fred Smith

What you've asked for is this:
=IF(OR(A2="BC",A2="WWW"),60,IF(OR(A2="FR",A2="FH"),120,IF(OR(A2="SS",A2="BS",A2="PS",A2="AS"),200,"not
in list")))

Personally, I would create a list, and use Vlookup.

Regards,
Fred
 
F

FSt1

hi
try..
=IF(OR(A2="BC",A2="WWW"),60,IF(OR(A2="FR",A2="FH"),120,IF(OR(A2="SS",A2="BS",A2="PS",A2="AS"),200,"")))

careful. the formula wrapped

Regards
FSt1
 

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

Top