A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
SUMIFS does not accept an array of criteria in a single argument, so using keys, {"*ASS SMALL*","*ASS CRATE*","*ASS TALL*"} in one SUMIFS call will always spill an array of results instead of one total.
A pattern that works is to calculate one SUMIFS per key and then sum those results. With LET and an array of keys this can be written compactly:
=LET(
items, J5:J35,
qty, L5:L35,
keys, {"*ASS SMALL*";"*ASS CRATE*";"*ASS TALL*"},
SUM( SUMIFS(qty, items, keys) )
)
Key points:
-
keysis a vertical array (;between items).SUMIFS(qty, items, keys)returns one subtotal per key, which spills. - Wrapping that in
SUM(...)adds those subtotals into a single result. -
itemsis the range with the item descriptions (e.g., “ASS CRATE - Crate for shipping”). -
qtyis the range withQuantitySold.
To extend this to more patterns, just add more entries to keys:
keys, {"*ASS SMALL*";"*ASS CRATE*";"*ASS TALL*";"*ASS PANELS*";"*ASS XYZ*"}
This keeps all the category patterns in one place and avoids helper columns while still using standard SUMIFS behavior with wildcards.
References: