LOOKING FOR BETTER SYNTAX

M

MIKE

There has got to be a better way to write this...
I'm Running Excel 2000.

=IF(OR(A2=C$2, A2=C$3,A2=C$4, A2=C$5,A2=C$6,
A2=C$7,A2=C$8, A2=C$9,A2=C$10,A2=C$11,A2=C$12,
A2=C$13,A2=C$14, A2=C$15,A2=C$16, A2=C$17,A2=C$18,
A2=C$19,A2=C$20,A2=C$21,A2=C$22, A2=C$23,A2=C$24,
A2=C$25,A2=C$26, A2=C$27,A2=C$28,
A2=C$29,A2=C$30,A2=C$31), "XXXXXX", " ")
 
B

Bernard Liengme

=IF(SUMPRODUCT(--(A2=C2:C28)),"XXXXXX","")

Some 50 years ago I had an Irish math teacher whose favourite expression was
"There are more ways of killing a pig than stuffing it with butter". How he
would have loved Excel!
 
A

Aladin Akyurek

Talking about a 'better syntax'...

=IF(ISNUMBER(MATCH(A2,C$2:C$31,0)),"XXXXXX", "")

Assumed "" instead of " ".
 

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