Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]() Hi I'm having a little trouble with a VLOOKUP function where I have a range of values spread over 9 columns with the lookup value appearing somewhere in the first column. What I need to do is have the function select the appropriate column based on yet another criteria. So, say I have a value that gets looked up in the first column as $500, and in one of the other columns (Column C, say) in the range corresponding to the looked up value is $350 (which is the $500 less tax say), but each of the columns represents a different tax rate depending on this other criteria. Am I able to use VLOOKUP where Value A ($500) gets looked up in Column A, but where Value B determines which column to go to across from the looked up value? I have a feeling I'm barking up the wrong function here, but I hope this makes sense. I would be grateful for any suggestions. JohnK -- JohnK ------------------------------------------------------------------------ JohnK's Profile: http://www.excelforum.com/member.php...o&userid=26498 View this thread: http://www.excelforum.com/showthread...hreadid=398026 |
#2
![]() |
|||
|
|||
![]()
You didn't say how column B specifies the return range for lookup. If a
3 in column B means the 3rd column from the lookup range (column A) on then: =VLOOKUP(LookupValue,A:J,VLOOKUP(LookupValue,A:B,2 ,0),0) JohnK wrote: Hi I'm having a little trouble with a VLOOKUP function where I have a range of values spread over 9 columns with the lookup value appearing somewhere in the first column. What I need to do is have the function select the appropriate column based on yet another criteria. So, say I have a value that gets looked up in the first column as $500, and in one of the other columns (Column C, say) in the range corresponding to the looked up value is $350 (which is the $500 less tax say), but each of the columns represents a different tax rate depending on this other criteria. Am I able to use VLOOKUP where Value A ($500) gets looked up in Column A, but where Value B determines which column to go to across from the looked up value? I have a feeling I'm barking up the wrong function here, but I hope this makes sense. I would be grateful for any suggestions. JohnK |
#3
![]() |
|||
|
|||
![]()
Hi
=VLOOKUP(LookupValue,LookupRange,NumericExpression ,0) LookupRange must be a continuous range, and must include the column with lookup values as leftmost, and must include all tax rate columns. NumericExpression must return an integer, representing the number of column with wanted tax rate in LookupRange (the leftmost column - the one containing lookup values - is 1st one). P.e. with value to look up in A2, LookupRange in Sheet2!$B$2:$K$1000, and the wanted tax group (integer values between 1 and 9) stored in C2: =VLOOKUP(A2,LookupRange in Sheet2!$B$2:$K$1000,C2+1,0) (3rd parameter is calculated as C2+1, because tax rates are in columns 2 to 10 of LookupRange) -- Arvi Laanemets ( My real mail address: arvil<attarkon.ee ) "JohnK" wrote in message ... Hi I'm having a little trouble with a VLOOKUP function where I have a range of values spread over 9 columns with the lookup value appearing somewhere in the first column. What I need to do is have the function select the appropriate column based on yet another criteria. So, say I have a value that gets looked up in the first column as $500, and in one of the other columns (Column C, say) in the range corresponding to the looked up value is $350 (which is the $500 less tax say), but each of the columns represents a different tax rate depending on this other criteria. Am I able to use VLOOKUP where Value A ($500) gets looked up in Column A, but where Value B determines which column to go to across from the looked up value? I have a feeling I'm barking up the wrong function here, but I hope this makes sense. I would be grateful for any suggestions. JohnK -- JohnK ------------------------------------------------------------------------ JohnK's Profile: http://www.excelforum.com/member.php...o&userid=26498 View this thread: http://www.excelforum.com/showthread...hreadid=398026 |
#4
![]() |
|||
|
|||
![]()
Assuming column B contains an integer between 1 and 9 (3 for Column C, 4 for
Column D etc) then: =VLOOKUP(A2,Sheet2!$A$2:$I$20,VLOOKUP(A2,Sheet2!$A $2:$B$20,2,0),0) Hope this helps Rowan "JohnK" wrote: Hi I'm having a little trouble with a VLOOKUP function where I have a range of values spread over 9 columns with the lookup value appearing somewhere in the first column. What I need to do is have the function select the appropriate column based on yet another criteria. So, say I have a value that gets looked up in the first column as $500, and in one of the other columns (Column C, say) in the range corresponding to the looked up value is $350 (which is the $500 less tax say), but each of the columns represents a different tax rate depending on this other criteria. Am I able to use VLOOKUP where Value A ($500) gets looked up in Column A, but where Value B determines which column to go to across from the looked up value? I have a feeling I'm barking up the wrong function here, but I hope this makes sense. I would be grateful for any suggestions. JohnK -- JohnK ------------------------------------------------------------------------ JohnK's Profile: http://www.excelforum.com/member.php...o&userid=26498 View this thread: http://www.excelforum.com/showthread...hreadid=398026 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP Limitations | Excel Worksheet Functions | |||
Have Vlookup return a Value of 0 instead of #N/A | Excel Worksheet Functions | |||
vlookup data hidden within worksheet | Excel Worksheet Functions | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions | |||
VLOOKUP problem | Excel Worksheet Functions |