Spreadsheet users often create formulas that suit their immediate needs, but over time, these can become difficult to understand or adjust when data or requirements change. Billions use spreadsheets, but poorly maintained formulas cost businesses hours in debugging or adjusting.

Store 1Store 2Store 3Store 4
Warehouse AApples299Warehouse AApples840Warehouse AApples219Warehouse AApples310
Warehouse ABananas232Warehouse ABananas436Warehouse ABananas28Warehouse ABananas633
Warehouse AOranges498Warehouse AOranges930Warehouse AOranges19Warehouse AOranges208
Warehouse BApples374Warehouse BApples519Warehouse BApples250Warehouse BApples302
Warehouse BBananas697Warehouse BBananas920Warehouse BBananas845Warehouse BBananas794
Warehouse BOranges604Warehouse BOranges183Warehouse BOranges544Warehouse BOranges83
Warehouse CApples557Warehouse CApples611Warehouse CApples560Warehouse CApples851
Warehouse CBananas688Warehouse CBananas12Warehouse CBananas328Warehouse CBananas393
Warehouse COranges955Warehouse COranges69Warehouse COranges393Warehouse COranges931

One common task for inventory management is to sum a particular product for all the stores. Most users rely on formulas like SUMIF

=SUMIF(B2:B10,"Apples",C2:C10)+SUMIF(F2:F10,"Apples",G2:G10)+SUMIF(J2:J10,"Apples",K2:K10)+SUMIF(N2:N10,"Apples",O2:O10)

While this does achieve the desired result, it comes with downsides; for example, if a store closed down which SUMIF is it, if new criteria, like quality or bundle types (e.g., 4-apple or 16-apple bundles), are added, requiring a SUMIFS function.

=INDEX(LET(
product,"Apples",
store_1,N(B2:B10=product)*C2:C10,
store_2,N(F2:F10=product)*G2:G10,
store_3,N(J2:J10=product)*K2:K10,
store_4,N(N2:N10=product)*O2:O10,
SUM(store_1,store_2,store_3,store_4)))

LET is extremely useful for documenting formulas allowing co-workers or our future selves to easily determine what the formula is doing, what each part is, and the ability to make changes with reduced chance of making a mistake.

N converts TRUE/FALSE to 1/0, enabling array multiplication for flexible criteria. For example

store_1,N(B2:B10=product)*C2:C10
Apples323
Bananas673
Oranges904
Apples892
Bananas64
Oranges721
Apples131
Bananas763
Oranges95

N(B2:B10=product) This step makes

1
0
0
1
0
0
1
0
0

Multiply that against the inventory column and you get

323
0
0
892
0
0
131
0
0

One common data structure is a pivoted table structure

PersonProduct6/16/26/36/46/56/66/7
BobApples9152338
SallyApples92961102
SarahApples7449576
GeorgeApples10473281
BobOranges10317391
SallyOranges5461772
SarahOranges9533694
GeorgeOranges3108971010

SUMIFS struggles with pivoted data, as it cannot directly handle multiple dimensions. Usually this path leads to a nested FILTER where we filter the rows where the product = “Apples” then FILTER that based on the date.

=SUM(FILTER(FILTER(C2:I9,B2:B9="Apples"),C1:I1=DATEVALUE("6/2/2025")))

This might be difficult to adjust later as you add more dimensions causing many nests.

=INDEX(LET(
products,N(B2:B9="Apples"),
dates,N(C1:I1=DATEVALUE("6/2/2025")),
sales,C2:I9,
SUM(products*dates*sales)))

N(B2:B9=“Apples”) outputs

1
1
1
1
0
0
0
0

N(C1:I1=DATEVALUE(“6/2/2025”)) outputs

0100000

matrix multiplication of these two outputs

0100000
0100000
0100000
0100000
0000000
0000000
0000000
0000000

Which you can see are the same dimensions as the sales

9152338
92961102
7449576
10473281
10317391
5461772
9533694
3108971010

which when you multiply those together you get

0100000
0200000
0400000
0400000
0000000
0000000
0000000
0000000

which gives us all the apples for that date!

It is arguably more abstract, however, you can add any number of criteria and label those criteria making things significantly more sustainable.

Array-based methods, while scalable, demand a learning curve and careful data structuring. Unlike SUMIF’s intuitive setup, LET/N requires understanding array multiplication, but its flexibility outweighs the initial complexity for multidimensional tasks, especially once you start adding even more dimensions to your data.

4D such as Person Product Grade Date

or 5D such as

Region, Person, Product, Price, Date

or 6D

Region, Person, Brand, Product, Price, Date

all the way to n-dimensions as data demands.

This allows us to by simply adding another line to the formula to add more criteria as we need.

RegionPersonBrandProduct6/16/26/36/46/5
Region ABobBrand AApples204122011
Region ASallyBrand AOranges1771518
Region ASarahBrand BOranges1831119
Region BBobBrand BApples161619412
Region BSallyBrand BApples11517717
Region BGeorgeBrand AOranges718311
Region BSarahBrand BApples91714715
=INDEX(LET(
regions,N(B2:B9="Region B"),
products,N(C2:C9="Apples"),
brands,N(D2:D9="Brand A"),
dates,N(E1:I1=DATEVALUE("6/2/2025")),
sales,E2:I9,
SUM(products*dates*sales*regions*brands)))

These methods apply to financial models such as revenue by region, product, quarter or logistics, for example, shipments by route, vehicle, date.

By applying this type of mentality, we can enable robust multidimensional analysis without the burden of nested filters that are hard to read, maintain, or debug.