SIMPLE REQUEST

  • Thread starter Thread starter shahrir
  • Start date Start date
S

shahrir

Guys,
i am very new, but need to do a very simple thing.
seeking help here.

1. Reference is on 1 cell that will have a number of ranging from 1-5 either
one.
2. Each number has something like 1=good, 2=bad etc.
3. Another cell will read the #1 cell and indentify what number is that then
return the result as good, bad etc based on which number appear in the cell
#1.

i think If function can do that but to no avail i cound figure it out.

pls help..

thnak you
 
Hi Shahrir!

Use a VLOOKUP function:

=VLOOKUP(A1,{1,"VG";2,"G";3,"OK";4,"B";5,"VB"},2)

Rather than use an internal array for the lookup, you could put your
data in a range of cells and refer to that range.
 
thanks man...its working
just wanted to know...what does the last before close bracket "2" stand for
?
 
shahrir

In a regular VLOOKUP you would have a 2 column table with 1,2,3,4 in say B1:B4

VG,G,OK,VB in C1:C4

=VLOOKUP(A1,B1:C4,2) would let Excel know to return from column C(2nd column
in the table)

If you notice, the internal array has semi-colons between the choices. This
emulates the 2 column table.

Change the 2 to 1 and see what happens.

Could also be written as =LOOKUP(A1,{1,2,3,4},{"VG","G","OK","VB"})

Here you can see the two parts of the table clearly.

Gord Dibben Excel MVP
 
Back
Top