Thread: "OR" in Formula
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Joe User[_2_] Joe User[_2_] is offline
external usenet poster
 
Posts: 905
Default "OR" in Formula

"Barb" wrote:
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 -----

"Barb" wrote:

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'.
--
Thanks!
Barb