assigning a letter in a cell from a range of numbers in another ce

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In creating a price list, I am looking for a way for a cell to read another
cell and determine if the number in that cell is between one number and
another. Depending on the range, I want to assign that cell a letter. For
ex:

if A1 is between 1 and 9, then cell C1 would = a, but if it is between 10
and 15, then cell C1 would = b, but if it is between 16 and 20, then cell C1
would = c, etc. etc.

Can anyone help me with this?
 
A very easy way is to use a VLOOKUP table. No VBA is required and the ranges
do not to be uniform.
 
=if(A1<1,"",if(A1<=9,"a",if(A1<=15,"b",if(A1<=20,"c","d"))))

you can nest 7 deep.

You can also explore a lookup table using vlookup.
in C22:D26

1 a
10 b
15 c
21 d
43 e

=if(Or(A1<1,A1="",istext(A1),"",VLOOKUP(A1,$C$22:$D$26,2,TRUE))
 

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

Back
Top