Vlookup and lookup

JV0710

Active Member
Joined
Oct 26, 2006
Messages
429
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Good day

Please can anyone help me with this query:

On Sheet 1 of my spreadsheet I have a list of products in rows down and Months in columns across. The months are not fixed and may change as periods roll ( e.g. first quarter to second quarter) - So column B can be "July_2007" now but can change to "October_2007" in a few months time. To help with my Vlookup reference, I have numbered the columns in row 1 ( column A =1, column B = 2 etc ).

On sheet 2 ( Cell E4) , I have a cell that I enter the Month name.

Also on Sheet 2, in ( cell E7 ), I have a vlookup that is looking for the "product" in (D7) in the list on sheet 1, then checking the Month in (E4) on sheet 2, find the column number that the month is in and return the data from that column.

The formula I am using in cell E7 is:
=VLOOKUP(D7,Report1!$A:$AY,LOOKUP($E$4,Report1!$A$5:$S$5,Report1!$A$1:$S$1),0)

The problem i am having is that the lookup function in the formula is only working if (cell E4) is the first month in the list ( cell B5 on sheet 1).

I hope this is making sense.

I would like to know what I am doing wrong or perhaps there is an easier way.

I would appreciate any help

Thank
JVN
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Let me see if I've got this right.

You want to input a date and a product name in sheet 2 and return a cell value from sheet 1 based on that input?
 
Upvote 0
Perhaps another way of asking this question . . .

I would like to do a lookup of some data in a table and return the column number that the data is in.

So, If I have table A1:D6 and in C4 there is my name . . . then i would like to do a lookup of my name in the table and return the column number that my name is in ( in this example - column 3 )

What is the formula to do this ?
 
Upvote 0
Hi Jongooligan

yes, in sheet 2 I want to enter the month ( Say July ) and product and return a cell value based on the input.

Looking up the product is fine because it is always in column A of the table that is being interogated. The month however may not always be in the same column . . . therefore i have to find a way to check the column number of the month.

Thanks
 
Upvote 0
Thank you Aladin

Your solution works great

with my formula I was getting results back for some dates and not for others . . .

JVN
 
Upvote 0
Aladin

Thank you again

I appreciate your help

JVN
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,772
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top