VLOOKUP if range is based on a cell value

mayday1

Board Regular
Joined
Oct 5, 2007
Messages
241
This works, simple VLOOKUP in a second file:
=IFERROR(VLOOKUP(B4,'[DataFeed.xlsx]Personnel'!$E$3:$F$100,2),"")

But now I need I need to do the VLOOKUP when the range in the second file is different in every day's file. Today it might be $E$3:$F$100 and tomorrow it might be $E$596:$F$999.

A1 in the first file contains the name of an employee - It's a drop down so I can change the name to the person I need data for. In the second file, Column A contains rows with the names of all employees (in alphabetical order). The other columns contain data I want my VLOOKUP to get data from.

So if A1 in the first file contains the name Bob, and Bob appears in the second file in rows 53 through 323, I need my VLOOKUP in the second file to use a range of $E$53:$F$323.
But then if I change A1 in my first file to Joe, and Joe appears in the second file in row 1233 through 1400, I need my VLOOKUP in the second file to use a range of $E$1233:$F$1400.

Possible? I can't use VBA on this one - needs to be a formula.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Is there any relationship between A1 and B4 ?
In the first file, the one where I need to do the VLOOKUP, Cell A1, and only that cell, contains the name of an employee. Column B is time of day.

Is the value in A1 also shown in E3:F1400?
In the other file, Column A contains the employees names. Column E contains time of day - same as Column B in the first file. So the name isn't in the range E3:F1400 but I could make the range A3:F1400, or whatever the relevant rows are, and include the name.

A key point maybe. The first file's Column B shows all possible times by minute from 7AM through 6PM. The second file contains rows only for times when an event happened.
So the first file has
07:00
07:01
07:02
07:03
etc.

And the second file might have only rows for
07:01
07:03
07:09
etc
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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