Dynamic range in formula

Deutz

Board Regular
Joined
Nov 30, 2009
Messages
201
Office Version
  1. 365
Platform
  1. Windows
Hi and thanks in advance.

I have a workbook with 50 sheets named by number from 1 to 50

On each named sheet in cell A2 will be an outcome of 'Pass' or 'Fail' that the user will enter after running each sheet process

On a Stats sheet I want to output the total number of sheets that contain 'Pass' in cell A2

However, the number of sheets that are tested are variable.

For instance, the user may be allocated tests/sheets from 1 to 10 or from 25 to 40 or 1 to 50 etc.

So, on the Stats sheet I have a Start sheet name/number cell and an End sheet name/number cell that the defines the range of sheets to be actioned.

I was thinking to use the INDIRECT function to pick up those start and end values and sumproduct them somehow to get the total of 'Pass'

I tried this =SUMPRODUCT(COUNTIF(INDIRECT("'"&F3:G3&"'!A2"),"Pass")) ... where cell F3 is the start sheet name and cell G3 is the end sheet name ... however, it did not give me the whole range of sheets defined.

Have had a few goes without success?

Any help would be appreciated
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try
Excel Formula:
=SUMPRODUCT(COUNTIF(INDIRECT("'"&SEQUENCE(G3-F3+1,,F3)&"'!A2"),"Pass"))
 
Upvote 0
Solution

Forum statistics

Threads
1,226,067
Messages
6,188,700
Members
453,493
Latest member
BRACE

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