Avatar of Frank .S
Frank .S
Flag for Australia asked on

if statement "m2" or "lm"- excel 2010

hi experts, id like some help with the following formula

=if(or(c12=c6,c12=c7),"m2",if(c12=c8,c12=c9,c12=c10,c12=c11),"lm",""))

basically if c12= c6 or c7 then show "m2" and if c12 = c8, c9, c10 or c11 then show "lm"
Microsoft Excel

Avatar of undefined
Last Comment
mark_harris231

8/22/2022 - Mon
SOLUTION
byundt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Frank .S

ASKER
hi byundt, i tried this formula but it did not work
ASKER CERTIFIED SOLUTION
Rgonzo1971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rory Archibald

What result did you get with Brad's (byundt) formula? I can't see how it would not work for what you describe - unless your excel version is actually 2003 or earlier?
byundt

Please post a sample workbook that demonstrates the formula not working.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
mark_harris231

Agree with byundt and rorya - byundt's solution should work.

Points to byundt please, but I did want to post an alternative using the CHOOSE function that might be useful when the criteria set is greater than two conditions:

- if C12= C6, then "m2"
- if C12=C7, then "q9"
- if C12 = C8, then "lm"
- if C12 = C9, then "lmno"
- if C12 = C10 or C11, then "xyz"

=CHOOSE(MATCH(C12,C6:C11,0),"m2","q9","lm","lmno","xyz","xyz")

This is the equivalent of the CASE function in other programming languages.