SumProduct Multiple Criteria into One and Filter Help

mpcubah

New Member
Joined
Nov 21, 2017
Messages
2
Hi - I have been working on this for a while and cannot figure it out - your help is greatly appreciated!!

I have a tab with a list of employee codes and their hours worked.

I have a 2nd tab with a list of employee codes and their cost.

I have written the formula to multiply them together - simple enough.

Here is where the trouble starts:

I need to be able to have duplicate employee codes on the 1st tab, with the ability to add rows and new employees (more of the same codes). So I need to have multiple instances of the same employee code on the 1st tab pointing to the same cost on the 2nd tab.

Then I need to have the ability to filter based on another criteria, and have the sumproduct recalculate based on just the items filtered on, (like subtotal(109)) would do.

To accomplish all of this I have created
=SUMPRODUCT(SUBTOTAL(103,OFFSET(Y7:Y30,ROW(Y7:Y30)-MIN(ROW(Y7:Y30)),,1)),(($D$7:$D$30='Rate Tables'!$B$7:$B$30)*1),(Y7:Y30*'Rate Tables'!$D$7:$D$30))

The problem is that creating a new row within this range causes an #N/A. I removed the $ so that I was pulling the full columns, which allowed me to add rows, however it did not recalculate or take the 2nd instance of the employee code into account.

I unfortunately cannot share the file due to the confidential costs.

Any idea on how I can solve this???
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hello mpcubah, welcome to MrExcel

Try like this, where the rate table references can remain the same but your other refs can expand

=SUMPRODUCT(SUBTOTAL(109,OFFSET(Y7:Y30,ROW(Y7:Y30)-MIN(ROW(Y7:Y30)),,1)),SUMIF('Rate Tables'!$B$7:$B$30,D7:D30,'Rate Tables'!$D$7:$D$30))

In that version note that I changed 103 to 109 to shorten, and SUMIF allows repeats in D7:D30

....so if you want to expand the range in 1st tab to row 100 that would look like this

=SUMPRODUCT(SUBTOTAL(109,OFFSET(Y7:Y100,ROW(Y7:Y100)-MIN(ROW(Y7:Y100)),,1)),SUMIF('Rate Tables'!$B$7:$B$30,D7:D100,'Rate Tables'!$D$7:$D$30))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,051
Members
452,542
Latest member
Bricklin

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