Replacement to SUMIFS

rhjake23

New Member
Joined
Dec 20, 2017
Messages
35
Hello.

I am trying to use if statements and/or sumproduct instead of sumifs. When using sumifs, my macros bog down.....
I am trying the following:

=IF(AND((AT2:AT1000=AT2,AW2:AW1000=AW2)),SUMPRODUCT(AV2:AV1000))

Basically, if the range of at2:at1000 = the value in AT2 and if the range of aw2:aw1000 = the value in AW2, sum up the values in the range av2:av1000.

Any input would be fantastic. Thank you.
 

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.
All those pieces should be in the SUMPRODUCT:

=SUMPRODUCT(--(AT2:AT1000=A2),--(AW2:AW1000=AW2),AV2:AV1000)
 
Upvote 0
Thanks again. I got it to work but the sumproduct function totally slows down the excel marco. I need to figure this out with just IF statements.
 
Upvote 0
No, you don't need the IF or the AND, but it's not that big of a range to slow it down that much. And how does a spreadsheet formula relate to your macro exactly?
 
Upvote 0
I run a api call macro which runs just fine if the excel file doesn't have all the sumifs and/or sumproduct functions. Once I add those functions within the excel file the macro totally slows down and takes approx. 5 times longer. Wondering if (if statements as an array or something) would work.
 
Upvote 0
Make a test: change recalculation to manual, run the macro, and then switch to automatic again.
 
Upvote 0
Put your macros here to review them, maybe "sumproduct" calculations can be included in the macro, then the macro will return to the sheet only the calculated values. That is, performing calculations on the sheet slows down operations, so the ideal is to perform all calculations in memory.

Also put a sample of your data with which your macros would work.

And in which cells you are putting the formula, only in one or a range of cells.
 
Upvote 0
I will try that...
Application.Calculation =​
xlManual...then
Application.Calculation = xlAutomatic at the end of the macro. Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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