Speedier Alternatives to SUMIFS

Tarver

Board Regular
Joined
Nov 15, 2012
Messages
109
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a fairly large dataset (350,000 rows) for which I need to sum data for 12,000 customers. Using SUMIFS is a long process and can take up to 10 minutes, because the same calculations are being repeated over and over again.

Is there a faster way?

Attached is a look at a sample of my data and a small table of the output I'm attempting to create. Your ideas on a faster way to calculate this result are welcomed! Thanks!

Predictive AR Model v1.xlsx
ABCDEFG
1Account noPosting dateDocument TypeAmount
210000967/1/2021SI$955.00Start Date7/5/2021
310000847/2/2021SI$960.00End Date7/16/2021
410000847/2/2021SI$1,395.00
510000847/2/2021SI$793.95CustomerAmount
610000847/2/2021SI$1,700.001000052$0.00
710000847/2/2021SI$375.001000084$20,428.00
810000847/2/2021SI$360.001000096$0.00
910000847/2/2021SI$1,235.00
1010000847/2/2021SI$960.00
1110000847/9/2021SI$740.35
1210000847/13/2021SI$618.00
1310000847/13/2021SI$1,728.00
1410000847/13/2021SI$713.00
1510000847/16/2021SI$424.00
1610000847/16/2021SI$470.00
1710000847/16/2021SI$2,610.00
1810000847/16/2021SI$572.00
1910000847/16/2021SI$1,055.00
2010000847/16/2021SI$25.00
2110000847/16/2021SI$3,745.00
2210000847/9/2021SI$465.65
2310000847/16/2021SI$6,560.00
2410000847/16/2021SI$702.00
2510000527/19/2021SI$822.00
2610000847/23/2021SI$3,190.00
2710000847/23/2021SI$835.00
2810000847/23/2021SI$1,070.00
2910000847/23/2021SI$4,480.00
3010000527/23/2021SI$358.25
31
Sheet1
Cell Formulas
RangeFormula
F6:F8F6=SORT(UNIQUE(Table4[Account no]))
G6:G8G6=SUMIFS(Table4[Amount],Table4[Account no],F6#,Table4[Posting date],">="&$G$2,Table4[Posting date],"<="&$G$3)
Dynamic array formulas.
 
One more point of follow-up for you: I've now updated my sheet to run your macro code when the desired date range is updated and I'm using it twice to get an average historical sales trend and then again to get a recent sales trend to compare the two. Ultimately the project is identify customers who may have financial issues, who have either slowed the rate at which they pay invoices or have suddenly spiked in new orders. Your contribution was a big help!
Thanks for letting me know 🙂
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What's weird here is that when I call this code from another piece of code that looks for changes, it always hangs up on this line with a "Method 'Range" of object '_Worksheet' failed:

1673020962847.png
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,782
Members
449,123
Latest member
StorageQueen24

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