Vlookup from files where the file & sheet names needs to be looked up also.

mike2008

Board Regular
Joined
Jan 31, 2008
Messages
50
This hopefully has a simple solution...

I have approximately 20 files with between 1 & 3 sheets, each of which needs to be consolidated using a vlookup or similar without merging them into one file due to the size.

Each sheet is named as the department to which the data relates, and each file is named according to the manager responsible for the combination of departments.

My consolidation needs to "dump" the data from columns Z to AN but on different rows within each file, and different combinations for each sheet.

I have an index within column Z which is a simple equation of MAX($Z$2:Z101)+1 for row 100 etc... the max number of lines to be transferred is then populated into Z1 to determine the number of lines to be consolidated for that sheet.

What I thought of was to firstly look up all the Z1's according to the sheet name (I don't care about the file name for the consolidation), and then have a row for each sheet name / row number combination valid, but then comes the difficult bit. How can I set the dependency in a vlookup to reference the correct sheet & file path within the vlookup? I don't know a way of creating a dependency in the vlookup for file name like you might for which column to reference.

I hope that all makes sence... & thanks for any answers you come up with.

Mike
 
That should work also... for my purposes I was just needing to set up a one off combination of spreadsheet consolidations.

I am still hopeful that it should be possible to create a vlookup or similar that also has to determine the file and sheet names from other cells, as I am sure you will agree the above steps were not simple - they served the purpose though which is all that mattered!!!
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,216,445
Messages
6,130,685
Members
449,585
Latest member
Nattarinee

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