# SUMIF with segmented array

#### just_jon

##### Legend
Problem: Raw data for ~400 items, with ~20 codes per item, in about 50k rows on 1 sheet as below -- the columns have been reshuffled and many deleted to fit the Html --
foox.XLS
ABCDEFGHIJ
1Item#CodeSortKeyEXTQTY/EISUUrunErunTotLbrU/PExtUP
20701XX10701-XX11.0000 \$384.7790\$384.78
30701YY10701-YY128.57891.09102.182010.7609\$-\$-
40825XX10825-XX13.0000 \$0.0130\$0.04
50825XX10825-XX11.0000 \$0.0480\$0.05
60825YY20825-YY21.0000.8480.8480.8480\$-\$-
70825YY20825-YY23.0000.73302.19902.1990\$-\$-
80834XX10834-XX10.1.0000 \$0.1940\$0.02
90834XX20834-XX20.1.0000 \$0.2240\$0.02
100834XX20834-XX22.0000 \$0.0250\$0.05
111051XX21051-XX24.0000 \$0.5000\$2.00
GB

Data is sorted by SortKey. The below is how I intend to go about accumulating the raw data into single-row data by Item # --

See next post...

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
foox.XLS
ABCDEFGH
31MaterialsLabor
32Iten#P/NXX1XX2YY1YY2StartStop
330701Blah\$384.78\$-10.761-23
340825Blah\$0.09\$--3.04736
350834Blah\$0.02\$0.07--68
361051Blah\$-\$2.00--88
Data

The qustion is -- is there a better way?
in C33: =IF(ISNA(G33),0,SUMIF(INDEX(GB!\$C:\$C,G33):INDEX(GB!\$C:\$C,H33),"="&\$A33&"-"&C\$32,INDEX(GB!\$J:\$J,G33):INDEX(GB!\$J:\$J,H33)))
in G33: =MATCH(A33,GB!A1:A11,0)
in H33: =MATCH(A33,GB!A1:A11)

Aladin -- have I followed the example in the BlackSwan topic well?

Replies
0
Views
353
Replies
6
Views
372
Replies
1
Views
1K
Replies
3
Views
1K
Replies
20
Views
1K

1,203,182
Messages
6,053,974
Members
444,695
Latest member
asiaciara

### 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?

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