Return all Sheet names containing a specified value

wiggy_worm

New Member
Joined
Jan 11, 2016
Messages
4
Hi,

Im trying to automate a table so that it adjusts column headers based on a drop-down cell at the top of the worksheet (in cell B1, defined as 'NAME'). The column headers need to adjust to only show the Sheet names that contain 'NAME' within cells E9:AZ9 in each sheet.
All sheets are listed in a named range 'SCHEMES'.

I can return either the first or the last Sheet name, but cant seem to get an array formula to return all of the possible matches.

Formula that returns the first match:

{=IF(ISERROR(INDEX(SCHEMES,MATCH(1,--(COUNTIF(INDIRECT("'"&SCHEMES&"'!$E$9:$AZ$9"),NAME)>0),0))),0,(INDEX(SCHEMES,MATCH(1,--(COUNTIF(INDIRECT("'"&SCHEMES&"'!$E$9:$AZ$9"),NAME)>0),0))))}

Can anybody help with an array formula that will return all matches found?

I then have a second question;
In a separate sheet I have a similar table that adjusts row/column headings. The data lookup then needs to search for a specific column corresponding to the row value across all sheets, and sum the results. The column location varies across the sheets, so I've set it up using the following formula that was an attempt to fudge an INDIRECT function by working out the column letter. While it works fine for up to column 'Z', as soon as the value goes above this the CHAR function doesn't work (starts returning symbols rather than jumping to 'AA', 'AB' etc).

Any ideas on how to fix?!

{=IF(ISERROR((SUMIFS(INDIRECT("'"&C$7&"'!"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"31:"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"136"),INDIRECT("'"&C$7&"'!D31:D136"),">="&$C$2,INDIRECT("'"&C$7&"'!D31:D136"),"<="&$C$3))/$B8),"",IF($C$4="Total Hours",((SUMIFS(INDIRECT("'"&C$7&"'!"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"31:"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"136"),INDIRECT("'"&C$7&"'!D31:D136"),">="&$C$2,INDIRECT("'"&C$7&"'!D31:D136"),"<="&$C$3))/$B8),((SUMIFS(INDIRECT("'"&C$7&"'!"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"31:"&(CHAR(68+MATCH($A8,INDIRECT("'"&C$7&"'!E9:AZ9"),0)))&"136"),INDIRECT("'"&C$7&"'!D31:D136"),">="&$C$2,INDIRECT("'"&C$7&"'!D31:D136"),"<="&$C$3))/($B8*((C3-C2)/7)))))}
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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