Dynamic array formulas automatically spill results into neighboring cells, allowing Excel to return multiple values from a single formula without manual range sizing.
Dynamic array formulas are a major evolution in Microsoft Excel that let a single formula output multiple values that automatically “spill” into adjacent cells. Introduced in Office 365, functions such as FILTER
, SORT
, SEQUENCE
, UNIQUE
, and the #
spill operator eliminate the need for Ctrl + Shift + Enter (CSE) legacy arrays and dramatically simplify multi-value calculations.
Whether you are cleaning data, prototyping business logic before pushing it into a database, or delivering ad-hoc analyses, Excel remains a universal scratch-pad for data work. Dynamic arrays make that scratch-pad behave more like a functional programming language—you write a formula once and Excel automatically sizes the output range. The result is:
Generates an array of sequential numbers. Syntax: =SEQUENCE(rows,[columns],[start],[step])
Returns unique values from a range or array. Syntax: =UNIQUE(array,[by_col],[exactly_once])
Filters a range based on Boolean criteria. Syntax: =FILTER(array,include,[if_empty])
Sorts a range or array. Syntax: =SORT(array,[sort_index],[sort_order],[by_col])
Sorts a range or array based on a parallel array. Syntax: =SORTBY(array,by_array,[sort_order])
Although XLOOKUP
is not itself an array function, it will spill if the lookup_value argument is an array.
Suppose you have a transactional sales log in A2:D10000
with the columns Date, Product, Salesperson, Revenue. You want a real-time list of top-5 products by total revenue:
SUMIFS
inside UNIQUE
:=LET(INDEX
to take only the first 5 rows:=INDEX(LET(The result spills a 5×2 array showing your best-selling products and their revenue, automatically refreshing as new transactions arrive.
LET()
: Use LET
to store intermediate arrays and keep formulas readable.Sales[Revenue]
) so your formulas remain resilient when rows/columns move.MAP
& LAMBDA
for row-wise logic: They vectorize naturally with arrays.Why it happens: Users manually enter data that collides with the dynamic array’s spill area, causing a #SPILL!
error.
Fix: Keep buffer rows/columns or convert the dynamic array output into a named range referenced elsewhere.
Why it happens: Mixing legacy formulas with dynamic arrays can unintentionally shrink an array to a single value.
Fix: Explicitly use the #
operator (e.g., ) to reference the entire spill.
Why it happens: Combining RAND()
, OFFSET()
, or INDIRECT()
with large dynamic arrays re-calculates frequently and slows the workbook.
Fix: Replace with non-volatile alternatives like SEQUENCE
, direct ranges, or helper tables.
"""Excel formulas for common scenarios"""
# 1. Generate calendar dates for the next year
a1: =SEQUENCE(365,1,TODAY(),1)
# 2. Remove duplicates from a column and sort alphabetically
a1: =SORT(UNIQUE(A2:A1000))
# 3. Two-way dynamic lookup: get latest price for each product
=MAP(UNIQUE(Products),
LAMBDA(p, XLOOKUP(1,(Products=p)*(Date=MAX(FILTER(Date,Products=p))),Price)))
# 4. Split comma-separated tags in Column A into rows below
a1: =TEXTSPLIT(A2,", ")
Dynamic arrays foster a set-based mindset. When you graduate from prototyping in Excel to querying production data in a SQL editor like Galaxy, many of the same constructs apply:
UNIQUE()
≈ SELECT DISTINCT
FILTER()
≈ WHERE
clausesSORT()
/SORTBY()
≈ ORDER BY
SEQUENCE()
≈ GENERATE_SERIES
(Postgres) or recursive CTEsLAMBDA
functions resemble subqueries or reusable CTEsBy mastering dynamic arrays first, you’ll write clearer, more efficient SQL later—and Galaxy’s AI copilot can then auto-translate your Excel logic into SQL queries, suggest optimizations, and let you version-control endorsed queries with your team.
No. They are available only in Microsoft 365, Excel for the web, and Excel 2021 or later.
Wrap the formula in INDEX
or reference a single element with @
(implicit intersection) to constrain it to one cell.
Yes. Append #
to the anchor cell (e.g., =A2#
) to capture the entire spill range.
While dynamic arrays live in Excel, the mental model of working with sets maps directly to SQL. Galaxy leverages that same paradigm, making it easier for spreadsheet users to transition to production-grade queries.
Dynamic arrays eliminate manual range management, reduce errors, and encourage set-based thinking that scales from Excel prototypes to production SQL—which is invaluable for data engineers and analysts who juggle ad-hoc analysis and maintainable pipelines.
No. They are available only in Microsoft 365, Excel for the web, and Excel 2021 or later.
Wrap the formula in INDEX or use the @ implicit-intersection operator to limit output to one cell.
Yes. Use the # operator (e.g., =A2#) to reference the full spill range.
Dynamic arrays teach set-based thinking similar to SQL. When you move to Galaxy’s editor, that mindset helps you write cleaner queries and leverage its AI copilot more effectively.