Sum if based on ranges of conditions

Thomasms90

New Member
Joined
Dec 15, 2015
Messages
4
Hi all,

I need to do a SUMIF that is rather advanced compared to what I'm used to since it must compare arrays of different sizes (or match them sequentially). I can't find a way to post a screenshot nor mock file, so I hope below is understandable.

I have an array A that consists of different types a, b, c, d, e, f.

Then an array B that contains ranges (lower and upper bounds) of unique identifiers that are connected with either a, b, c, d, e, or f (i.e. 1000 to 1099 belongs to a, 1100 to 1249 belongs to a, and 3000 to 3099 belongs to a, and so forth for other types).

Finally an array C that contains a very large data range of a given identifier and an associated value.

I need to do a sumif of the values in array C, given that the identifier is within any of the given ranges in array B that are associated with a given type.

Currently, my only solution is to split it up into several formulae parts, where I have 1 SUMIFS() for each identifier in array B that matches the type in array A. But this is unfeasible in my actual workbook and very manual.

Is there a way to do this in one formula? I've tried SUM(IF()) arrays, but that won't work as it usually does, since the arrays are not of the same size.
 

Excel 2010
ABCDEFG
1SumsIdentifiersrange
2TypeSumLBUBTypeIDValue
3a1210001099a10003
4b111001249a12001
5c1712501499f14008
6d1015001519e160010
7e1015201599c18001
8f2016001699d20002
917001999b22008
1020002499c24007
1125002999e26002
1230003099a28008
1331003499f30008
1432007
1534005
1636009
1738009
Sheet8 (5)
Cell Formulas
RangeFormula
B3=SUMPRODUCT($G$3:$G$17,COUNTIFS($C$3:$C$13,"<="&$F$3:$F$17,$D$3:$D$13,">="&$F$3:$F$17,$E$3:$E$13,A3))
 
Upvote 0

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.

Forum statistics

Threads
1,215,343
Messages
6,124,404
Members
449,156
Latest member
LSchleppi

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