A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Use a cell-driven sheet reference, so the source sheet name is controlled from one place.
In the “address book” workbook or control sheet:
- Put the source sheet name in one cell, for example
A1 - Enter values like
S1,S2,S3,S4in that cell - Build the reference from that cell instead of hard-coding
S1
The Excel pattern for using a sheet name stored in a cell is:
=INDIRECT("'"&A1&"'!A22")
For the current scenario, the same idea applies: replace the fixed sheet name in the external reference with text built from the control cell.
Example structure:
=INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&A1&"'!C6:DB105")
and for the BYROW range:
=INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&A1&"'!G6:DB105")
Then the FILTER formula becomes this pattern:
=FILTER(
INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&A1&"'!C6:DB105"),
BYROW(
INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&A1&"'!G6:DB105"),
LAMBDA(r,SUM(r)>0)
),
"N"
)
How to set up the address book sheet:
- Create a sheet, for example
Control - In
A1, store the active source sheet name:S1 - Optionally list allowed sheet names below it:
-
A2 = S1 -
A3 = S2 -
A4 = S3 -
A5 = S4
-
- In the workbook that contains the FILTER formula, change
A1to the required sheet name whenever the source must switch
If the control cell is on a sheet named Control, use Control!A1 instead of A1:
=FILTER(
INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&Control!A1&"'!C6:DB105"),
BYROW(
INDIRECT("'Q:\Presentations\PE_31\O_Analysis and calculation\Fatigue\Backups_Marcros\Fatigue Assesment_as per 17949_Welded Joints\[DB_Data_Collectives_2.xlsm]"&Control!A1&"'!G6:DB105"),
LAMBDA(r,SUM(r)>0)
),
"N"
)
If only the workbook link itself needs to be created or changed manually, Excel also supports creating workbook links by typing = and selecting the source workbook and sheet, or by using Paste Link.