VLookup Value across multiple sheets and return sheet name

unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

I'm having a hard time with this.

I need a code that will look for a value on multiple sheets and return it's sheet name.

So in a workbook I have 4 sheets namely: Raw, Name1, Name2, Name3 & Name4
"Raw" sheet contains names only and as for the other sheets, it has below data.

NameCityCountryID
Sam New YorkUnited States001
AnnaLondonUnited Kingdom020
SeanOsloNorway030

<tbody>
</tbody>


So in Raw tab, the final data will look like this:

NameRVL NameRVL CityRVL CountryRVL IDSheet Source
SamSamNew YorkUnited States001Name1
AnnaAnnaLondonUnited Kingdom020Name2
SeanSeanOsloNorway030Name3

<tbody>
</tbody>


Thank you!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Create a range in a convenient location, which houses the names of the relevant sheets one by one. Select that range and name the selection SheetList using the Name Box on the Formula Bar.

In F2 of Raw, control+shift+enter, not just enter, and copy down:

=INDEX(SheetList,MATCH(TRUE,COUNTIFS(INDIRECT("'"&SheetList&"'!A2:A100"),$A2)>0,0))

In B2 of Raw just enter and copy down:

=VLOOKUP($A2,INDIRECT("'"&$F2&"'!A:D"),1,0)

In C2 of Raw just enter and copy down:

=VLOOKUP($A2,INDIRECT("'"&$F2&"'!A:D"),2,0)

In D2 of Raw just enter and copy down:

=VLOOKUP($A2,INDIRECT("'"&$F2&"'!A:D"),3,0)

In E2 of Raw just enter and copy down:

=VLOOKUP($A2,INDIRECT("'"&$F2&"'!A:D"),4,0)
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,940
Members
449,275
Latest member
jacob_mcbride

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