need help with formula (ex. if c4=E, then d4=10).....

  • Thread starter Thread starter corrado
  • Start date Start date
C

corrado

I have a question that I need some help with. I am trying to create a
spreadsheet that can recognize a letter and provide another cell with a
corresponding number. For example, if cell C4=E, then D4=10, if C4=P
then D4=3 etc. I can't figure out what sort of a formula to use or how
to do this. Thanks in advance for your help....
 
Hi Corrado:

Try the following as a basis:

D4 formula
=IF(C4="E",10,IF(C4="P",3,"")

If there are a lot of possibilities for C4 and different results in D4
then you might be better off using VLOOKUP.

Create a table of possibilities in (say) H1:I7 such as

E 10
P 3
C 2
D 1
F 10
CP 9
N 2

Then use a formula such as:

=VLOOKUP(C4,$H$1:$I$7,2,FALSE)

C4 is the cell being looked up
H1:I7 is the range of the table being looked up (made absolute to
facilitate copying the formula to other cells
2 is the column in the table
FALSE tell Excel to look for an exact match


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top