View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carlo carlo is offline
external usenet poster
 
Posts: 367
Default Assign a letter to a number and then retrive

Hi ppmorise

Just to make things clear:
C4 and C7 is text in your example, right?
Because in Excel, if you put one (or two) letters and then a number
together it can also be the address of a Cell in Excel, so be careful
to explain when you ask a question, otherwise you probably get wrong
answers.

For my answer I just assume that C4 and C7 is actually text, otherwise
correct me.

Now, the question is, where will the data be put in? and how?
is it in one cell (A1) and looks like: 3,5,7,22,12
or is every number in a different cell?
cell A1: 3
cell A2: 5
cell A3: 7

if it is the second one, then you can use the function "VLookup" in
Excel.
For that you need a matrix, it's probably best if you put it in
another sheet (on the bottom you should see 3 tabs with sheet1, sheet2
and sheet3).
The matrix should look like this:
column A: your number
column B: your corresponding text
that way you should have a matrix which is 28 rows high and 2 columns
wide, and let's say you put that in sheet2

Let's say you have your data in sheet1 column A (starting at A1) and
you want the corresponding text in Column B, so you can put following
formula in B1:
=vlookup(A1,sheet2!A1:B28,2,false)

Of course you need to have this formula in all cells, so now you can
copy it down. You select cell B1 and move your cursor to the lower
right corner of Cell B1 until it changes into a cross (not a cross
with arrows, just a cross) and then you can double click (it will fill
out all cells below, until there is no more data in column A) or click
and drag it down as far as you want.

Hope that helps you

Carlo