How do I create a 26 'tier' IF formula?

G

Guest

hi, um, I've been trying to create a 26 tier IF formula so to speak. I would
like to be able to create a formula so that everytime i write a letter, the
corresponding number will be typed in another cell. ie. if i type 'a' the
number '1' will appear, nd so on, ie. a=1 b=2 c=3 etc.

I tried to use an IF formula but of course you can only use seven levels or
'tiers'.

If i could use 26 levels, my formula would look like this:
=IF(K7="A",1,
IF(K7="B",2,
IF(K7="C",3,
IF(K7="D",4,
IF(K7="E",5,
IF(K7="F",6,
IF(K7="G",7,
IF(K7="H",8,
IF(K7="I",9,
IF(K7="J",10,
IF(K7="K",11,
IF(K7="L",12,
IF(K7="M",13,
IF(K7="N",14,
IF(K7="O",15,
IF(K7="P",16,
IF(K7="Q",17,
IF(K7="R",18,
IF(K7="S",19,
IF(K7="T",20,
IF(K7="U",21,
IF(K7="V",22,
IF(K7="W",23,
IF(K7="X",24,
IF(K7="Y",25,
IF(K7="Z",26,))))))))))))))))))))))))))

However, as I said, i could only use seven.
Does anyone have any ideas of other formulas that would give the same effect
as a 26 tier IF formula?

thanks in advance
Callum
 
C

Chip Pearson

Callum,

You don't need an IF statement at all. Use the following formula:

=CODE(A1)-96


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
C

Chip Pearson

The formula in my reply assumes you are using lower case letters.
For upper case letters, use

=CODE(A1)-64


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
R

Ragdyer

To add to Chip's fine suggestion, you could use this for either:

=CODE(UPPER(K7))-64
 
C

Cutter

Use this in the cell where you've been trying the IF():

=MOD(CODE(A1),64)

or

=CODE(A1)-64
 

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