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"
Frank .SBuilding EstimatorAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rgonzo1971Connect With a Mentor Commented:
=if(or(c12=c6,c12=c7),"m2",if(or(c12=c8,c12=c9,c12=c10,c12=c11),"lm",""))
0
 
byundtConnect With a Mentor Commented:
=IFERROR(IF(MATCH(C12,C6:C11,0)<3,"m2","lm"),"")
0
 
Frank .SBuilding EstimatorAuthor Commented:
hi byundt, i tried this formula but it did not work
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Rory ArchibaldCommented:
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?
0
 
byundtCommented:
Please post a sample workbook that demonstrates the formula not working.
0
 
mark_harris231Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.