FORMULA HELP

B

B.B

I am cant get this to work, I need a formula so cell A1 will show 1 if cell
A2 is A, 2 if B and 3 if C
thanks to all
 
D

Dave Peterson

Maybe...

=code(upper(a1))-64

B.B said:
I am cant get this to work, I need a formula so cell A1 will show 1 if cell
A2 is A, 2 if B and 3 if C
thanks to all
 
V

Vince Parsons

How about using some "IF" statements as follows:
=IF(A2="A",1,IF(A2="B",2,IF(A2="C",3,"")))

If A2 does not equal A, B or C, then the cell will be blank.

Dave's formula is better...
 
J

Joerg

Sorry, this was not what you asked for. I'll give it another try:
=MATCH(A2,{"A","B","C",""})
This will result in 1,2 or 3 for one of the characters in the array, and 4
for all other characters. It's not case sensitive. It results in an error if
A2 contains a numeric value.

Joerg
 
O

OM

Dave,

What a clever way of doing this ! I was thinking of nested If's but this is
much simpler.


Rob Lepper
 
Top