The short answer
A dynamic array formula is a formula that can return more than one value. Instead of putting a single result in one cell, it fills a block of cells with its results. Excel calls this spilling, and the block of cells it fills is the spill range.
Dynamic arrays work in Excel for Microsoft 365, Excel 2021 and Excel for the web. Older versions, such as Excel 2019, don’t support them. In those versions, functions such as FILTER and UNIQUE show a #NAME? error.
How spilling works
Type a formula in one cell and press Enter. If the result has more than one value, Excel puts the first value in the cell where you typed the formula. It fills the other values into the cells below or to the right.
For example, type =SEQUENCE(5) into cell D2. Excel fills D2 through D6 with the numbers 1 to 5. Click D2 and you’ll see a border around the whole spill range. Only D2 holds the formula. The other cells show the results.
To change the result, edit the formula in the top-left cell. Don’t type over the other cells. If you do, the spill stops and Excel shows a #SPILL! error.
Functions that return arrays
Several Excel functions are built to return arrays:
- FILTER returns the rows that meet a condition. If you want to learn how to use filter function in excel, start with its include test, which is the part that picks the rows.
- UNIQUE returns each distinct value once. If you need an excel formula to remove duplicates, UNIQUE is usually the place to start. It doesn’t delete anything from your sheet.
- SORT and SORTBY return rows in a new order and leave the original data where it is. When you want to sort data with formula in excel, these are the functions to know.
- SEQUENCE creates a list of numbers. If you’re looking for how to generate sequence of numbers in excel, this is the function that does it.
- RANDARRAY creates random numbers, and XLOOKUP can return more than one value when its return range has several columns.
LET is different. It doesn’t return a list. It gives names to parts of a formula so the formula is easier to read. Readers who search for a let function in excel example usually want to see names used in a real formula, and that’s the best place to start.
When the spill is blocked
If any cell in the spill range isn’t empty, Excel can’t spill and shows #SPILL!. The usual causes are typed values below the formula, a merged cell in the way, or a result that would run off the edge of the sheet. Clear the blocking cells, or move the formula to a place with room. Learning how to fix #spill error in excel is the quickest way to recover.
Referring to the whole result
Add # after the cell that holds the formula to refer to the entire spill range. For example, =SUM(D2#) adds up everything that D2 currently spills. The reference grows or shrinks as the result changes. To point another formula at the whole result, learn how to reference spill range in excel.
The @ symbol
Sometimes Excel adds @ to a formula, such as =@A2:A10. This is implicit intersection. It shows up in formulas written in older versions of Excel, where a range could return one value based on the row the formula sat in. The @ keeps that older behavior.
New dynamic array formulas usually don’t need @. Remove it only after you check that the formula should return a list, because removing it can change the result.
Dynamic arrays in Google Sheets
Google Sheets has the same idea with different rules. FILTER, SORT, UNIQUE and SEQUENCE fill their results on their own, with no extra steps. Some formulas that work on a whole range need ARRAYFORMULA around them. To see how that’s written, look at an arrayformula google sheets example.
Older array formulas
Before dynamic arrays, array formulas were entered with Ctrl+Shift+Enter, and Excel wrapped them in curly braces. Dynamic array formulas don’t need that. If you see braces in a workbook, the formula is an older array formula. It will still calculate, and you can usually leave it alone.
Checking your Excel version
Open File > Account to see which Excel product and version you have. If you’re not sure whether your version supports dynamic arrays, type =SEQUENCE(3) into an empty cell. If the numbers 1, 2 and 3 appear down the column, your version supports them. If you see #NAME?, it doesn’t.
Key points
- A dynamic array formula returns many values and spills them into the cells around it.
- The formula sits in the top-left cell of the result. Don’t type over the spilled cells.
- A blocked spill shows #SPILL!. Clear the cells in the way.
- The # operator refers to a whole spill range, and @ is usually a leftover from older Excel.