### excel

#### VBA to Optimize SUMIFS with Multiple Criteria with Criteria Ranges [on hold]

```First, I've looked all over for a solution and haven't found any so far. Here are a couple Q&As I've found that touch on this topic, but I haven't gotten either of them to work for my application yet because I'm not sure how to specify a range of critiera (e.g., as I would with the formula):
=sumifs(SUMRANGE,CRITERIARANGE1,">="&VALUE1,CRITERIARANGE1,"<="&VALUE2)
https://www.mrexcel.com/forum/excel-questions/895977-huge-dataset-looking-sumifs-alternative.html
How to perform SumIf using VBA on an array in Excel
So, my problem is that I have a similar issue as that in the above posts. I've got data in seven columns (unsorted) that has the following layout:
HDR1 HDR2 HDR3 HDR4 HDR5 HDR6 HDR7
00 000000 A000 0000 000000 \$\$\$ \$\$\$
The first 5 columns are my criteria ranges. Column 6 & 7 are debits/credits respectively. I've got over 900,000 rows of data. Columns 1, 2, & 3 are segmentation codes that will be specified precisely and could potentially be concatenated if that would improve calculation time. Columns 4 and 5 are GL codes and date values respectively, and I need to sum all the values that fall within specified ranges for each of those. (I actually need to sum the values in Column 6 using the criteria and then sum the values in Column 7 using the same criteria and subtract the result of the second from the result of the first). So an example result would be:
For all posts with Criteria 1 = "10", Criteria 2 = "100216", & Criteria 3 = "R102":
GLFrom 7100 7200 7300 7400
DateFrom DateTo GLTo 7199 7299 7399 7499
10/01/15 12/31/15 SUM SUM SUM SUM
01/01/16 03/31/16 SUM SUM SUM SUM
Then I would need to paste the resulting values into a range.
I need some VBA that can do this very quickly because I need to cycle through over 200 combinations of codes for the first three segments.
(Not that anyone cares, but this is to run regression analyses on the data to predict future expenditures looking for cycling/trend.)```

Encrypt Message

code
soft
python
ios
c
html
jquery
cloud
mobile