• 546K Members
• 2,138 Online
• 652K Conversations
SOLVED

Highlighted
New Contributor

# Counta/CountIF autopopulate range from different sheet, where the sheet name may change

Hello,

I don't know if this is possible, I have a very unique situation. We use Excel for our test cases, usually multiple sheets in one file. The main sheet is a summary results page, where we summarize how many tests have been executed, how many passed, failed etc. To do this we utilize the COUNTA and CountIF formulas and reference the other sheets.

for example

=COUNTA(Sheet2!A2:A25)

=COUNTIF(Sheet2!M2:M300,"P")

Our issue is, the name for the sheets change by project, and it takes a long time to change all the sheet names in all the formulas in this page. Especially when we have 30 sheets. In the summary sheet we have a column with all of the sheet names, is there a way to autofill the sheet name from the previous column?

Including a screenshot to help visualize what I am trying to explain. Each cell in columns b, c, e, f, and g have a formula referencing another sheet. Is there a way to take the sheet2 name from the previous column and make it so that it has the ! to reference the other sheet in the formulas, automatically without having to fill it in manually each time a sheet name is changed.

Any and all help is much appreciated!

3 Replies
Highlighted
Solution

# Re: Counta/CountIF autopopulate range from different sheet, where the sheet name may change

Try this formula in G2, and copy down rows:
=COUNTIF(INDIRECT(A2&”!M1:M300”),
“N/A”)
Highlighted

# Re: Counta/CountIF autopopulate range from different sheet, where the sheet name may change

That worked!! For some reason it didn't like the formatting from here, but when I typed it into my formula your recipe worked! thanks so much!!

# Re: Counta/CountIF autopopulate range from different sheet, where the sheet name may change

You're very much welcome!

Related Conversations
COUNTIF not working
sme527 in Excel on
10 Replies
Totaling using two sets of data
dazedandconfused in Excel on
2 Replies
COUNTIF help
brentonhobden in Excel on
3 Replies