For convenience only,data(C5:E16) andgroup(B5:B16) arenamed ranges.

If you are using an older version of Excel, use the SUMPRODUCT option.

The section on advanced criteria covers both options.

A clever all in one formula option

The reason is that SUMIFS expectssum_rangeto be the same size ascriteria_range.

What about the SUMIF function?

Basically, SUMIF resizessum_rangeto match therangeargument.

A clever all in one formula option

This kind of “silent failure” is dangerous because the resultseems reasonablebut is, in fact,incorrect.

You may not like formula errors, but at least they tell you something is wrong!

FILTER solution

In the current version of Excel, a nice solution is theSUM functionwith theFILTER function.

A clever all in one formula option

As the formula is copied down, it calculates the correct sum for each group.

With just a single array to process, SUMPRODUCT sums the array and returns a final result: 526.

For more information about this particular logic,see this example.

A clever all in one formula option

The output from FILTER is dynamic.

If source data or criteria change, FILTER will return a new set of results.

These values can be numbers, cell references, ranges, arrays, and constants, in any combination.

A clever all in one formula option

SUM can handle up to 255 individual arguments.

GROUPBY Function

The Excel GROUPBY function is designed to summarize data by grouping rows and aggregating values.

The result is a summary table created with a single formula.

Excel formula: Sum if multiple criteria

BYROW can apply stock functions like SUM, COUNT, and AVERAGE or a custom LAMBDA function.

Excel formula: Average if with filter

Excel formula: Cell contains specific text

Excel SUMPRODUCT function

Excel SUMIFS function

Excel FILTER function

Excel SUM function

Excel GROUPBY function

Excel BYROW function

Article image

Article image

A clever all in one formula option