Subtotal and Sumif | Need faster calculation than using sumproduct

mavsounds

New Member
Joined
Mar 2, 2017
Messages
9
Hi, I got this formula idea from an old thread here. I successfully got the formula to work, but it's very slow. Is there a simpler process?

=IF(A2="","",SUMPRODUCT(SUBTOTAL(9,OFFSET('Partner Planner'!C2,ROW('Partner Planner'!$C:$C)-ROW('Partner Planner'!C2),0)),('Partner Planner'!$A:$A=A2)+0))


Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It’s hard to suggest anything when only the formula is available. It’s hard to picture your exact situation
However, my first guess is that the two references to entire columns is not helping performance.

Is it possible to change the $C:$C to $C2:C1000 (or whatever the situation warranted) ?
Same with the $A:$A ?

If yiu limit both both of these column references does the performance improve ?
If not ... can you describe what you are actually trying to do ?


BrianGGG
 
Upvote 0
Hi

2 options

Option 1 - very bad idea to use whole columns with SumProduct() and Offset().

Use a range just big enough to contain your data, like rows 2:1000


Option 2 - easier and quick: use an auxiliary column to check if 'Partner Planner'!$C:$C is visible.

Ex: use column Z.

In Z2: =SUBTOTAL(9,'Partner Planner'!C2)
Copy down

Then your SumProduct() becomes:

=IF(A2="","",SUMPRODUCT($Z$2:$Z$1000*('Partner Planner'!$A2:$A1000=A2)))

Adjust the last row


Try both and see which is quicker to calculate.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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