Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dba dba is offline
external usenet poster
 
Posts: 1
Default assigning a letter in a cell from a range of numbers in another ce

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?
--
dba
one day at a time
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default assigning a letter in a cell from a range of numbers in another ce

A very easy way is to use a VLOOKUP table. No VBA is required and the ranges
do not to be uniform.
--
Gary''s Student - gsnu200723
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default assigning a letter in a cell from a range of numbers in another ce

=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))


--
Regards,
Tom Ogilvy

"dba" wrote:

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?
--
dba
one day at a time

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning letter for numerical value Reno Excel Discussion (Misc queries) 8 April 29th 10 06:43 AM
Assigning a point value to a range of numbers wmb Excel Discussion (Misc queries) 2 August 7th 08 03:26 PM
change order of 5 letter word based on another cell containing 5 numbers Forum Freak[_2_] Excel Worksheet Functions 5 July 19th 08 08:39 PM
i need to know how to total letter on a cell instead of numbers mei Excel Discussion (Misc queries) 2 April 20th 06 05:32 PM
Assigning a number value to a letter? Orphan86 Excel Discussion (Misc queries) 3 August 30th 05 11:45 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"