Indirect SUMIF formula needed to calculate across multiple tabs and documents

colinheslop1984

Board Regular
Joined
Oct 14, 2016
Messages
129
Office Version
  1. 2016
=SUMIF(INDIRECT("'"&$C$5&"'!c$12:c$25"),$C$9:$C$22,INDIRECT("'"&$C$5&"'!M$12:M$25"))

Currently using this formula to gather information from a spreadsheet which has a large number of tabs, 1 tab = 1 week of the year. The tab name is referred to as c5 in the above formula, the rest is standard criteria.

I have 5 sheets representing 5 locations. I would like to add in to each sheet a total column for all the locations that will work in the same way as it does now, only gathering the information for the weeks selected in C5 but from across all 5 spreadsheets.

Any ideas how to do this? Please respond with formula suggestions
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Nobody?

=SUMIF(INDIRECT("'"&$C$5&"'!c$12:c$25"),$C$9:$C$22,INDIRECT("'"&$C$5&"'!M$12:M$25"))

Currently using this formula to gather information from a spreadsheet which has a large number of tabs, 1 tab = 1 week of the year. The tab name is referred to as c5 in the above formula, the rest is standard criteria.

I have 5 sheets representing 5 locations. I would like to add in to each sheet a total column for all the locations that will work in the same way as it does now, only gathering the information for the weeks selected in C5 but from across all 5 spreadsheets.

Any ideas how to do this? Please respond with formula suggestions
 
Upvote 0
This will get you started
Sub summarize()
For a = 1 To Sheets.Count
Cells(a, 1) = Sheets(a).Name
'Cells(a, 2) = Application.WorksheetFunction.SumIf(Range("C2:C22"), Sheets(a).Range("b2:b22"), ">10")
Next a
MsgBox "complete"
End Sub
running this macro will list all sheet names in Col A. suitably modify the sumif to suit your needs and remove ' before running it. it should calculate the sum and put in col B
Ravi
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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