ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Lookup range help (https://www.excelbanter.com/excel-discussion-misc-queries/207970-lookup-range-help.html)

tom

Lookup range help
 
I am trying to find out if there is a way to return a specified column in a
vlookup formula, with a changing selection. For example...

Month Jan Feb Mar Apr

Cust
1 20 15 25 30
2 10 8 30 15
3 45 55 63 49

In my formula I would like the Month column to change, when I specify what
month I am looking for. I am trying to see if I can keep the formula the
same and change the month in an index sheet, and have my lookup reference the
index sheet.


Sheeloo[_3_]

Lookup range help
 
You want to change the index in the VLOOKUP?
Change 2 to anything between 1-12 in the formula above?
=VLOOKUP(A1,Sheet!A:M),2,FALSE)

You have many options
Repalce 2 with any cell address say N1 like below
=VLOOKUP(A1,Sheet!A:M),2,FALSE)

or refer to the column no it is
=VLOOKUP(A1,Sheet!A:M),Column(),FALSE)
If you are entering this in Col D then you will get 4 in place of Column()

and so on
You can use INIRECT, INDEX, MATCH... etc to get the desired index.

Hope this is what you were looking for...

"Tom" wrote:

I am trying to find out if there is a way to return a specified column in a
vlookup formula, with a changing selection. For example...

Month Jan Feb Mar Apr

Cust
1 20 15 25 30
2 10 8 30 15
3 45 55 63 49

In my formula I would like the Month column to change, when I specify what
month I am looking for. I am trying to see if I can keep the formula the
same and change the month in an index sheet, and have my lookup reference the
index sheet.


Dave Peterson

Lookup range help
 
It looks like you could use =index(match()).

Debra Dalgleish explains it he
http://www.contextures.com/xlFunctions03.html (for =index(match()))
and
http://contextures.com/xlFunctions02.html#Trouble

Take particular notice of example 2:
http://www.contextures.com/xlFunctio...ml#IndexMatch2

Tom wrote:

I am trying to find out if there is a way to return a specified column in a
vlookup formula, with a changing selection. For example...

Month Jan Feb Mar Apr

Cust
1 20 15 25 30
2 10 8 30 15
3 45 55 63 49

In my formula I would like the Month column to change, when I specify what
month I am looking for. I am trying to see if I can keep the formula the
same and change the month in an index sheet, and have my lookup reference the
index sheet.


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com