Return all sheet names a value appears on

Mydako

New Member
Joined
Apr 19, 2018
Messages
26
I'm looking for a formula that lets me input a value, and the output would be a list of whatever sheets in the workbook that value appears on. I don't have the slightest idea in this case, or know if it's even possible. It can't be VBA because our work computers can't all handle it.

Longer context:

My company has thousands of items that we sell to hundreds of retailers. I have a master workbook that has a sheet for each retailer and a list of all the items they sell. Sometimes though an item is discontinued, or needs a price change, or whatever. I have to search the sheets, go to those retailers, change the information, and log it. While I can use Find All, I was wondering if I could make a formula where I could put the item ID# into a cell, and then beside it I would receive a list of sheets(retailers) that have that ID#. If I have something that outputs all the sheet names it will make it a lot easier for me to properly report and log the changes, otherwise it's a lot of back and forth between vlookups and Find All.

But for all I know this might not be possible, if it is, it's outside my usual box for thinking of these things.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Here is one way
ID assumed to be in column A in each subsidiary sheet

Add a sheet (I named it "Qry")
List sheets from A2 downwards (see below if you cannot paste a list from somewhere and want to avoid all that typing)
Formula in B2 copied down:
=COUNTIF(INDIRECT("'"&A2&"'!A:A"),$B$1)
In the picture below, values in column B are the number of times ID0010 appears in colunn A in each sheet (named R1,R2,R3)

Excel 2016 (Windows) 32 bit
A
B
C
D
1
Sheet
Name
ID0010 Formula
2
Qry
0​
=COUNTIF(INDIRECT("'"&A2&"'!A:A"),$B$1)
3
R1
6​
4
R2
0​
5
R3
1​
6
Sheet: Qry

Automating list of sheets
The list of sheet names in column A can be automated like this:

Create Named Range with name "Sheets" and RefersTo
=SUBSTITUTE(GET.WORKBOOK(1),"["&GET.WORKBOOK(16)&"]","")

Formula in A2 copied down until #REF ! appears
=INDEX(Sheets,ROWS($A$1:$A1))

NOTE - formula does not auto-update if sheet names are changed, sheets added or deleted
Select cell A2 \ {F2} followed by {ENTER} to force A2 to update \ drag down formula until #REF ! appears
 
Upvote 0
It can't be VBA because our work computers can't all handle it.

You may want to ignore Automating Sheet Names
- the technique illustrated uses a precursor to VBA
- I forgot that the workbook must then be saved as macro enabled even though everything is done by formula :oops:
 
Last edited:
Upvote 0
Thanks so much Yongle, that's perfect. Sure I'll have to make my own list cause of the VBA issues, but that's just something that needs to be done once. Thanks this will really make my life easier after the next round of discontinuations. I can just add a filter to sort out the ones that match.
 
Upvote 0

Forum statistics

Threads
1,214,886
Messages
6,122,093
Members
449,064
Latest member
Danger_SF

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