Function Problems

Subtotal LET Dynamic Arrays Without SUMIFS in Excel

Adam DavisAdam Davis Nov 18, 2026 868 views

Question details

Calculate subtotals for dynamic arrays created inside an Excel LET formula.

Subtotal LET Dynamic Arrays Without SUMIFS in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula uses LET and CHOOSECOLS to create calculated arrays that need to be grouped and subtotaled.
Observed behavior
SUMIFS can return an error when calculated arrays are passed as its criteria or sum ranges instead of worksheet range references.
Before you start

Check that your Excel version supports LET, CHOOSECOLS, UNIQUE, HSTACK, MAP, LAMBDA, and FILTER. Leave enough empty cells below and to the right of the formula for the results to spill.

Solution 1Recommended

Use FILTER and SUM to subtotal each unique value

Use this approach when the criteria and value columns exist as calculated arrays inside LET rather than as worksheet ranges.

UNIQUE creates the list of groups, and MAP runs a LAMBDA for each group. FILTER selects the matching values, SUM totals them, and HSTACK places the groups beside their totals.

1
Enter the example formula

Select an empty worksheet cell and enter: =LET(_data,{"A",1;"A",1;"A",1;"A",1;"A",1;"B",1;"B",1;"B",1;"B",1;"B",1},_crit_col,CHOOSECOLS(_data,1),_val_col,CHOOSECOLS(_data,2),_criteria,UNIQUE(_crit_col),HSTACK(_criteria,MAP(_criteria,LAMBDA(c,SUM(FILTER(_val_col,_crit_col=c))))))

2
Check the spilled results

Press Enter. The formula should spill two columns showing A with a subtotal of 5 and B with a subtotal of 5.

3
Adapt the data source

In the formula bar, replace the array constant assigned to _data with your calculated two-column array. If the criteria and numeric values are in different columns, adjust the column numbers in CHOOSECOLS.

Use FILTER and SUM to subtotal each unique value
Use numeric values: The value column should contain numbers to be summed. If Excel reports a spill error, clear the cells needed for the output.
Free Microsoft Office alternative

Work with spreadsheet subtotals in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface and Excel format compatibility for easier migration. It does not fix Excel's SUMIFS range requirement; check function support before using formulas that rely on newer dynamic-array functions.

Use spreadsheet formulas to calculate subtotals from worksheet dataOpen and edit Microsoft Excel XLSX filesNavigate a familiar spreadsheet interfaceUse a free, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Why does SUMIFS fail with an array created inside LET?

SUMIFS expects range references for its sum and criteria ranges. An array calculated by LET or CHOOSECOLS is not necessarily a worksheet range, so passing it directly can cause an error.

Can I use SUMIFS if the data is in worksheet cells?

Yes. For example, use =SUMIFS(B2:B11,A2:A11,D2) to sum values in B2:B11 where A2:A11 matches the criterion in D2.

What does MAP do in the subtotal formula?

MAP applies the LAMBDA to each value returned by UNIQUE. For each value, FILTER selects matching rows and SUM calculates their subtotal.

Why does the formula show a spill error?

The result needs empty cells for both the group names and subtotals. Clear any occupied cells in the intended spill area and recheck the formula.