Dynamic Arrays in Excel Explained Simply
By ExcelReady TeamUpdated 6 min read
The short answer
Dynamic arrays let one Excel formula return several values that spill into the cells below or beside it. Type =UNIQUE(B2:B9) in one cell and the whole list appears, then resizes when the data changes. They need Excel 2021, Excel 2024, Microsoft 365 or Excel for the web. Refer to a whole spill with a # after its first cell, such as E2#.
Key takeaways
- A dynamic array formula is typed in one cell and spills its results into neighbouring cells.
- FILTER, SORT, SORTBY, UNIQUE and SEQUENCE are the core dynamic array functions.
- E2# refers to everything the formula in E2 spilled, and grows or shrinks with it.
- #SPILL! means something is in the way: clear the cells or move the formula.
- Dynamic arrays need Excel 2021 or later (or Microsoft 365); Excel 2019 doesn't spill.
On this page+
Dynamic arrays in Excel are formulas that return many values at once and spill them into the cells around the formula. You type =UNIQUE(B2:B9) in one cell, press Enter, and the full list appears below it, resizing whenever the data changes. This guide explains spilling, the # spill reference, the #SPILL! error and version support in plain English, for anyone meeting FILTER, SORT or UNIQUE for the first time.
What are dynamic arrays in Excel?#
A dynamic array formula returns an array, which is simply a list or grid of values, instead of a single value. Excel writes the first value in the cell where you typed the formula and the rest in the cells beside or below it. That behaviour is called spilling, and the cells it fills are the spill range.
Before dynamic arrays, one formula meant one result in one cell. To list unique regions you needed helper columns or a complicated formula confirmed with Ctrl+Shift+Enter. Now one short formula does it.
Version note: dynamic arrays are available in Microsoft 365, Excel 2021, Excel 2024, Excel for the web and current versions of Excel for Mac. Excel 2019 and older don't spill.
How spilling works#
Type the formula in one cell and Excel fills as many cells as the result needs. Here is a list of orders:
| A | B | C | E | |
|---|---|---|---|---|
| 1 | Order | Region | Amount | Regions |
| 2 | SO-201 | West | 1,250 | East |
| 3 | SO-202 | East | 980 | North |
| 4 | SO-203 | South | 1,640 | South |
| 5 | SO-204 | East | 720 | West |
In E2, type:
=SORT(UNIQUE(B2:B9))UNIQUE returns each region once, SORT puts them A to Z, and the four results spill into E2:E5. A few things to notice:
- Only E2 holds the formula. Click E3 and the formula bar shows it greyed out. You can't edit or delete E3 on its own.
- A blue border marks the spill range when you select any cell in it.
- It resizes itself. Add an order from a new region and the list grows by one row.
The core dynamic array functions#
These functions were designed to return arrays:
| Function | What it returns | Learn more |
|---|---|---|
| FILTER | Rows that meet a condition | FILTER function |
| UNIQUE | Each value once | UNIQUE function |
| SORT / SORTBY | A sorted copy of a range | SORT and SORTBY |
| SEQUENCE | A list of numbers | SEQUENCE function |
| RANDARRAY | A grid of random numbers |
XLOOKUP can spill too, when you ask it to return several columns. Microsoft 365 and Excel 2024 add more, such as TEXTSPLIT, VSTACK, HSTACK, TAKE and DROP.
The FILTER function guide is a good place to start, because FILTER replaces many manual filtering jobs with a formula that updates by itself.
Array maths: formulas on whole ranges#
Dynamic arrays also change how ordinary maths works on ranges. Multiply two columns in one formula and you get one result per row:
=B2:B6*C2:C6With quantities in B and prices in C, this spills five line totals. Wrap it in SUM to get one number, =SUM(B2:B6*C2:C6), without Ctrl+Shift+Enter. Comparisons work the same way: =C2:C9>1000 spills a column of TRUE and FALSE, which is exactly the kind of test FILTER uses.
How to refer to a spill with#
Type # after the first cell of a spill to refer to the whole result. This is called a spill reference:
=COUNTA(E2#)E2# means "everything E2 spilled". If the list grows from four regions to five, the count updates too. A fixed range like E2:E5 would miss the new one.
Spill references are useful for chaining formulas. A SUMIFS can total each region in the list, =SUMIFS(C2:C9,B2:B9,E2#), and it spills one total per region next to the list. A drop-down list can use a spill as its source too: in Data > Data Validation, set Allow to List and the source to =$E$2#.
What the #SPILL! error means#
#SPILL! means the formula can't put its results where they need to go. The most common causes:
- Something is in the way. A cell in the spill range isn't empty, even if it only holds a space. Clear it.
- Merged cells in the spill range. Unmerge them.
- The formula is inside an Excel table. Tables don't allow spills. Move the formula outside the table.
- The result is too big to fit before the edge of the sheet.
Click the warning icon next to the error and choose Select Obstructing Cells to jump to the blocker. Our guide to the #SPILL! error covers each cause with fixes.
Dynamic arrays in older Excel files#
Dynamic arrays change how some older formulas behave, so Excel protects them in two ways.
The @ sign. If you open an older workbook, Excel may add @ to formulas such as =@A2:A10. The @ is the implicit intersection operator: it tells Excel to return a single value, as older versions did, instead of spilling. The formula gives the same result it always did.
Opening a new file in old Excel. If you share a workbook with someone on Excel 2019, a spilled formula shows as an old-style array formula in braces, and functions that didn't exist then, such as FILTER or UNIQUE, show #NAME?. Check which version your team or a job test uses before relying on dynamic arrays.
Common dynamic array combinations#
Most real work combines two or three functions. These come up again and again in reports and interviews:
| Task | Formula |
|---|---|
| Count unique customers | =COUNTA(UNIQUE(A2:A100)) |
| Count matching rows | =ROWS(FILTER(A2:C100,B2:B100="East")) |
| Matching rows, largest first | =SORT(FILTER(A2:C100,B2:B100="East"),3,-1) |
| A to Z list without repeats | =SORT(UNIQUE(B2:B100)) |
For a ranked list, see our guide to a top 5 list with SORT and FILTER. Data analyst roles lean on these functions heavily; our list of Excel skills for data analysts shows where they fit alongside pivot tables and lookups.
Practise it#
Try the exercise above to spill a sorted list of regions. Then practise in the UNIQUE lesson, where you list and count distinct customers, and the FILTER lesson, where you pull matching rows with AND and OR conditions in a live spreadsheet.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Make a tidy list of the regions. In E2, use SORT around UNIQUE on B2:B9 so each region appears once, A to Z, and spills down.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Amount | Regions | ||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 | ||||||
| 9 | ||||||
| 10 | ||||||
| 11 | ||||||
| 12 |
Tip: UNIQUE removes the repeats and SORT puts them in order. SORT goes on the outside.
Practise this in a lesson
Frequently asked questions
What are dynamic arrays in Excel?
Dynamic arrays are formulas that return more than one value. Excel places the results in the cells next to the formula, called spilling, and updates the size of the result automatically.
Which versions of Excel have dynamic arrays?
Microsoft 365, Excel 2021, Excel 2024, Excel for the web and current Excel for Mac. Excel 2019 and older don't spill; new functions such as FILTER show #NAME? there.
What does the # sign mean in an Excel formula like E2#?
It is a spill reference. E2# means the whole range that the formula in E2 spilled, however many rows and columns it has.
What does the @ sign mean in my formulas?
@ is the implicit intersection operator. Excel adds it to formulas from older workbooks that expected a single value, so they keep returning one value instead of spilling.
Do I still need Ctrl+Shift+Enter?
Not in Excel 2021, Excel 2024 or Microsoft 365. Press Enter and array formulas spill on their own. Ctrl+Shift+Enter is only needed in Excel 2019 and older.