View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
FurRelKT FurRelKT is offline
external usenet poster
 
Posts: 42
Default Help with looking up value in list

Hello,
I need some help understanding what i need to do inorder to :
1. take the value in Q2, it is a string
2. compare it to a value in the list in another sheet
3. look at the first column in the lookup, then it might not match, so
look in the second column.
(my lookup has three column, the first is the main column, an alias in
the second column, then a type column.)

for ease this example is using row 2 insead of i:
Sheet1:
L2 Q2
[need the formula here] TESTA
[need the formula here] THIS

lookup product list
A B C
1. TEST TESTA Primary
2. THIS THISA Primary

What i need:
In the first row, Q2, [TESTA] the value i need checked, is checked in
the lookup for a match, it doesn't find it in the first column, so it
goes to the next column in the lookup to check it, it's found in the
second column in the lookup so, i want to fill the value in L2 with
that value from the lookup [TESTA]. If it still doesnt find the match,
then put "Bad" in L2.
In the second row, didn't need to go to the second lookup column
because it was already found in the first column of the lookup.

this is what i have tried:
**already in a loop
strRel = Cells(i, 17).Value
Cells(i, 12).Formula = _
"=IF(ISERROR(VLOOKUP(" & Cells(i, 17).Address & _
",ProductList,1,False)),""BAD"",VLOOKUP(" & _
Cells(i, 17).Address & ",ProductList,1,False))"

Now, i dont know how to check for the other column in the
lookup...please help.

Maybe i should be doing this another way than lookup.... any ideas will
really be helpful as well as explaining the way it's done.

Hope that i have explained what i need,Thanks in advanced.

Keri