Sum cells in multiple worsheets that meet a specific criteria

luismffaria

New Member
Joined
May 22, 2017
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I have several sheets (each a project sheet), and two aggregated sheets that would represent 2 companies (each company aggregating part of the projects).
On each aggregated sheet (company) I want to sum the production of the projects that corresponds to it.
So, I've started something like:
=SUMPRODUCT(SUMIF(INDIRECT("'"&project_codes_list&"'!B5"),$B$5,INDIRECT("'"&project_codes_list&"'!K380")))
where,
"project_code_list" would be the list of the project sheets
on cell "B5" of each project sheet I would put the name/code of the company

Problem is that it works for that specific cell K380 (which corresponds do Dec 2017), but with this formula I cannot drag it to the right to get the corresponding amounts to the following year (column L: Dec 2018, column M: Dec 2019,...) because it keeps the same K380...

Any thoughts? I would prefer not to use VBA

Thank you
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I've also tried to do a sumif like this:
=+SUMPRODUCT(SUMIF(INDIRECT("'"&project_codes_list&"'!K371:EZ371"),K165,INDIRECT("'"&project_codes_list&"'!K380:EZ380"))*(SUM(INDIRECT("'"&project_codes_list&"'!B5"))=$B$5))
Problem is that the 2nd part where I would have the limitation is not working...
 
Upvote 0
I have several sheets (each a project sheet), and two aggregated sheets that would represent 2 companies (each company aggregating part of the projects).
On each aggregated sheet (company) I want to sum the production of the projects that corresponds to it.
So, I've started something like:
=SUMPRODUCT(SUMIF(INDIRECT("'"&project_codes_list&"'!B5"),$B$5,INDIRECT("'"&project_codes_list&"'!K380")))
where,
"project_code_list" would be the list of the project sheets
on cell "B5" of each project sheet I would put the name/code of the company

Problem is that it works for that specific cell K380 (which corresponds do Dec 2017), but with this formula I cannot drag it to the right to get the corresponding amounts to the following year (column L: Dec 2018, column M: Dec 2019,...) because it keeps the same K380...

Any thoughts? I would prefer not to use VBA

Thank you

How about this:

=SUMPRODUCT(SUMIF(INDIRECT("'"&project_codes_list&"'!B5"),$B$5,INDIRECT("'"&project_codes_list&"'!K"&379+COLUMNS($A$1:A1))))
 
Upvote 0
it doesn't work... I still can't drag it across the row...

Oh yes, my error.. I see it now.

=SUMPRODUCT(SUMIF(INDIRECT("'"&project_codes_list&"'!B5"),$B$5,INDIRECT("'"&project_codes_list&"'!"&ADDRESS(380,COLUMNS($A$1:K1)))))
 
Last edited:
Upvote 0
it would work if it was to drag it across the rows. i was trying your formula and substitute the column with the address formula, but I'm not figuring out how...
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,596
Members
452,657
Latest member
giadungthienduyen

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