Using worksheet name in formula

jeffreysdunn

New Member
Joined
Nov 13, 2011
Messages
35
I have identically formatted worksheets named Q12022, Q2022 etc. On a summary sheet I have column headers with the same names. How do I reference the correct worksheet in a sumif formula on the summary sheet?

my formula is:

=sumif('Q32022'!J:J,C4,'Q32022'!H:H)*D4

I want to substitute the content of a cell (k2 for instance) for the worksheet name Q32022.

Many thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about
Excel Formula:
=SUMIF(INDIRECT("'"&K2&"'!J:J"),C4,INDIRECT("'"&K2&"'!H:H"))*D4
 
Upvote 0
Solution
Works nicely. I'm not sure I understand what the indirect function is doing but I'll research that.

Thanks again.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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