Forum Discussion
Alternate to SUMIFS array assistance
- Mar 15, 2025
A few more array options to experiment with:
=MMULT(--(TOROW(Table2[Date]) = Table3[Date]), (XLOOKUP(Table2[Item Code], Table1[Item Code], Table1[Category], "") = Table3[[#Headers],[Blue]:[Red]]) * Table2[Units])
Complete with column headers and row labels:
=LET( criteria, DROP(Table3[#Headers],, 1), category, XLOOKUP(Table2[Item Code], Table1[Item Code], Table1[Category], ""), result, MMULT(--(TOROW(Table2[Date]) = Table3[Date]), (category = criteria) * Table2[Units]), HSTACK(Table3[[#All],[Date]], VSTACK(criteria, result)) )
Alternatively, using SUM-SUMIFS with "thunks" (LAMBDA(x)) and broadcasting:
=LET( grϑup, TRANSPOSE(GROUPBY(Table1[Category], Table1[Item Code], LAMBDA(x, LAMBDA(x)), 0, 0)), bcλst, LAMBDA(b, IF(b, Table3[Date], TAKE(grϑup, -1))), result, MAP(bcλst({0}), bcλst({1}), LAMBDA(c,d, SUM(SUMIFS(Table2[Units], Table2[Date], d, Table2[Item Code], c())))), HSTACK(Table3[[#All],[Date]], VSTACK(TAKE(grϑup, 1), result)) )
There's also a basic SUMIFS example in the attached file (on the Production worksheet), using a helper column for "Category"...
In B2:
=SUMPRODUCT(Table2[Units], (Table2[Date]=[@Date])*(XLOOKUP(Table2[Item Code], Table1[Item Code], Table1[Category])=Table3[[#Headers],[Blue]]))
In your real workbook, try replacing Table3[[#Headers],[Blue]] with B2#
- Eng_NoahMar 11, 2025Brass Contributor
Thanks for replying, HansVogelaar
I'm trying to edit the code into my real workbook. However, I'm simply getting blank results instead of a spilled array.
Any idea what may be wrong? Any information you need on my behalf?
- HansVogelaarMar 13, 2025MVP
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
- Eng_NoahMar 17, 2025Brass Contributor
Sharing with you an updated example with comments.
Thanks for taking the time to help me out!