How to reference a sheet using a cell

portugeezers

New Member
Joined
Dec 4, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
So I have a master sheet and multiple more detailed sheets that feed into the master. All the smaller sheets follow the same template so I am able to use indirect addressing to extract the data I need for the master sheet. Now on the master sheet, I am trying to check if a value/cell in the master sheet is contained in an array (row of 10 cells) for each of the smaller sheets. How should I do that? I am using the current formula:

=IF(COUNTIF('City A'!$D$10:$D$20,$E$2),"Yes")

Now instead of typing City A for the sheet, I want to try and reference the cell I created for the sheet and all other sheets. Is this possible?

Any help would be great!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Yes, INDIRECT function is what you are looking for. Assuming your sheetnames are in column A:
Excel Formula:
=IF(COUNTIF(INDIRECT("'"&A2&"'!$D$10:$D$20"),$E$2),"Yes")
Using INDIRECT is not recommended because it is a volatile function which means it will recalculate each time you open the workbook that may lead to increased load times.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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