Another method to speed up SUMPRODUCT

CelestialMind7

New Member
Joined
Mar 29, 2019
Messages
13
Hi guys,

first time poster, long time lurker. First of all I want to thank you all for your awesome contributions. Thanks to you guys my vba skills have improved and I was able to find solutions to many questions I had in the past.

Having said that, I've searched and searched for the solutions for this but what I've found hasn't worked for me.

I've developed a very large and fairly complex reporting tool for my company that generates metrics and other reports for the management. There is one part that slows down the entire report and it's the SUMPRODUCT formula. Is there another way without doing a concatenate like helper column? SUMIFS doesn't work btw. Here's the formula:

=SUMPRODUCT(--(Consolidated!N:N=A2)*(Consolidated!K:K="Pending Action"),--(Consolidated!V:V>0),--(Consolidated!V:V<>""))

One column is doing a calculation from a raw consolidated data tab that's around 200k rows which is why it takes quite a long time to complete.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
One thing I should probably mention, I simply replaced SUMPRODUCT with SUMIFS so something tells me the rest of the formula is wrong since this is originally specifically designed for a sumproduct layout.
 
Upvote 0
Hi,

sumproduct is much slower than sumifs and countifs

https://exceloffthegrid.com/optimize-formula-calculation-speed-part-8-sum-with-multiple-criteria/

https://www.mrexcel.com/forum/excel-questions/561914-sumifs-vs-sumproduct-calc-time.html


You could try

=Countifs(CONSOLIDATED!N:N,A2,CONSOLIDATED!K:K,"Pending Action",CONSOLIDATED!V:V,">0",CONSOLIDATED!V:V;"<>")

or you could try to reduce ranges read by SUMPRODUCT


=SUMPRODUCT(--(Consolidated!N$1:N$200000=A2),--(Consolidated!K$1:K$200000="Pending Action"),--(Consolidated!V$1:V$200000>0),--(Consolidated!V$1:V$200000<>""))

Regards
 
Upvote 0
Hi,

sumproduct is much slower than sumifs and countifs

https://exceloffthegrid.com/optimize-formula-calculation-speed-part-8-sum-with-multiple-criteria/

https://www.mrexcel.com/forum/excel-questions/561914-sumifs-vs-sumproduct-calc-time.html


You could try

=Countifs(CONSOLIDATED!N:N,A2,CONSOLIDATED!K:K,"Pending Action",CONSOLIDATED!V:V,">0",CONSOLIDATED!V:V;"<>")

or you could try to reduce ranges read by SUMPRODUCT


=SUMPRODUCT(--(Consolidated!N$1:N$200000=A2),--(Consolidated!K$1:K$200000="Pending Action"),--(Consolidated!V$1:V$200000>0),--(Consolidated!V$1:V$200000<>""))

Regards

Thank you Canapone, I actually figured it out before I got a chance to look back into this thread :)
SUMIFS solved my problem along with COUNTF in the other column. went from almost 2 hours down to 25 minutes flat. Very happy about that.
 
Upvote 0
Ciao,

thanks for your kind feedback

I also use often SUMPRODUCT: more flexibility, more versatile...
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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