Excel Formula That Returns an Array: How-To Guide
In this article
You get an Excel formula to return an array by writing a formula whose result is more than one cell — either because it naturally produces multiple values (like =SEQUENCE(3) or =A2:A10*2) or because you want one formula to spill into several cells. In current Excel for Microsoft 365, Excel 2024 and Excel for the web, you type the formula into a single cell and press Enter: Excel spills the results into the cells below and to the right, showing a thin blue outline around them. Nothing extra is needed — no Ctrl+Shift+Enter. In older versions without dynamic arrays, the same formula must be entered as a legacy array formula or the results will not appear as expected.
What You'll Need
- Excel for Microsoft 365, Excel 2024, Excel 2021, or Excel for the web for dynamic arrays. Excel 2019 and earlier do not support spilling; there you use Ctrl+Shift+Enter array formulas instead, which behave differently.
- Data arranged in a clean block with a single header row if you are referencing a table or range; blank rows and merged cells inside the source range cause gaps in results.
- Enough empty space below and to the right of the formula cell for the results to land in. If any cell in the spill area is occupied, Excel returns a #SPILL! error rather than overwriting your content.
Versions differ slightly: button labels and ribbon positions can vary by release, device and region, so if a named option is not exactly where described, look for the closest match in the same tab.
Step-by-Step
- Pick an empty cell with room around it. Choose a cell you can afford to fill downward and to the right. A formula returning five values needs four empty cells below (or beside) it. Selecting a cell inside an existing data block is the most common reason spill formulas fail.
- Write a formula that produces multiple values. The simplest test is
=SEQUENCE(5), which returns 1 through 5 down a column. Other natural array-producers include=UNIQUE(A2:A20)for a de-duplicated list,=SORT(A2:A20)for sorted values,=FILTER(A2:A20,B2:B20="Open")for rows matching a condition, and arithmetic on a range such as=A2:A10*1.1, which multiplies every value at once. Any of these entered in one cell returns an array. - Press Enter, not Ctrl+Shift+Enter. In a version with dynamic arrays, a plain Enter is enough. Excel displays the results in neighbouring cells with a blue outline and a small border marker at the corner of the formula cell. Editing the formula changes the whole spilled block at once — you only ever edit the top-left cell.
- Wrap the result in a function if you want one value back. Many people ask for an array because they want a calculation across a range, such as a conditional sum.
=SUM(FILTER(C2:C20,B2:B20="Open"))takes the array from FILTER and collapses it to a single total. This avoids helper columns entirely. - Use
INDEXto pull a single item out of an array. If you want only the third result of=FILTER(...), write=INDEX(FILTER(B2:B20,C2:C20>100),3). To grab the last item regardless of size,=INDEX(FILTER(...),COUNTA(FILTER(...)))works, though it is easier to read with a helper cell holding the filtered result. If the requested item does not exist, INDEX returns #REF!. - Enter a legacy array formula if you are on Excel 2019 or earlier. Select the exact output range first (for example five cells), type the formula, then press Ctrl+Shift+Enter. Excel wraps it in braces
{ }and fills the selected cells. To change it later you must select the whole block again, edit, and press Ctrl+Shift+Enter once more; you cannot change the size of the block by editing one cell. - Copy the spilled result correctly. Click the top-left cell of a spilled range and copy normally — the whole block copies. Pasting into another area pastes the same array. If you need fixed values rather than a live formula, use Paste Special > Values on the copied block.
- Check the reference operator if you need a true array constant. Instead of a range, you can hard-code values with braces and separators:
{1,2,3}is a horizontal array and{1;2;3}is vertical in most English-locale setups. Commas separate columns and semicolons separate rows; in some regional settings the separators are reversed, so check what your version accepts.
Common Mistakes
- #SPILL! because the target area is blocked. Excel will not overwrite existing content. Delete or move what is below or beside the formula, or move the formula itself. Clicking the warning icon next to the cell usually offers a Select Obstructing Cells option.
- Pressing Ctrl+Shift+Enter in a modern version. This still works but forces a legacy array formula, which locks the output to a fixed size and cannot resize when the source data changes. Use plain Enter for dynamic arrays unless you are deliberately working in an older file.
- Typing the formula into a merged cell. Merged cells cannot spill. Unmerge first (Home tab > Merge & Center) or place the formula elsewhere.
- Editing a cell inside the spill block. Excel blocks this with a #SPILL! error because the block is owned by the top-left formula. Edit only the original cell, or convert the block to static values first.
- Forgetting that empty cells become 0 in arithmetic. Multiplying a range that contains blanks returns zeros. Wrap with IF or use FILTER to drop blanks.
- Using an array formula inside a real Excel Table incorrectly. Tables have their own structure; a spill formula placed in one column may collide with the calculated column. Place dynamic array formulas outside the table, or use the table's own column formulas.
Tips
- Use
SEQUENCEto build number series, dates (with a start date plus an increment) or row/column grids for testing a formula before applying it to real data. - Combine
SORT,FILTERandUNIQUEin a single formula to build a live summary table that updates as source data changes. - Name the spilled range if you want to refer to it elsewhere: select the block and give it a name in the Name Box. Refreshing data that changes the block's size can break the reference, so prefer referring to the original range in other formulas.
- To see what an array contains mid-formula, select just the inner part (for example the FILTER expression) in the formula bar and press F9 to preview the result. Press Esc afterwards to avoid committing the preview.
- If you only need the total or count of a filtered array, wrap it in SUM or COUNTA immediately rather than spilling it and summing the block separately.
Troubleshooting
You see a single value instead of a block. The formula may reference a single cell rather than a range, or you may be on an older Excel version without dynamic arrays. Confirm the referenced range spans multiple cells, and confirm the version under File > Account (the About Excel dialog shows the version). On older versions, use Ctrl+Shift+Enter over a pre-selected range.
You see #SPILL!. Clear the cells in the way, unmerge any merged cells in the area, and check for a hidden row or column blocking the block. If the obstruction is not obvious, click the error cell and use the warning menu to jump to it.
The result is #CALC! or #VALUE!. #CALC! usually means the function produced an empty array — for example FILTER found no matching rows. Add an if-empty argument where the function supports one, such as =FILTER(range,criteria,"No matches"). #VALUE! often comes from mismatched range sizes in arithmetic.
The block shrinks when data changes. That is normal: dynamic arrays resize to fit. Anything you placed directly below will be pushed down or blocked. Leave a buffer of empty rows beneath spill formulas.
Sharing the file breaks the formula. Someone opening it in an older Excel version sees legacy array results or errors. If the file must work everywhere, paste the results as values or use traditional formulas with helper columns.
Frequently Asked Questions
Do I still need Ctrl+Shift+Enter?
Only in Excel 2019 and earlier or when a file is set to legacy calculation behaviour. In Microsoft 365, Excel 2021, Excel 2024 and Excel for the web, plain Enter is correct.
Why does my formula return only the first value?
Most often the source is a single cell instead of a range, or implicit intersection applies because the formula sits in a table column. Reference a full range such as A2:A20 and place the formula outside the table.
Can I use an array result in another formula?
Yes. Nest it, for example =SUM(FILTER(C2:C20,B2:B20="Open")), or point INDEX at it to extract one element.
How do I stop the spill block from changing size?
Convert it to static values: copy the block, then Paste Special > Values over the same spot. The link to the source data is lost, so updates will no longer flow through.
Why does a blank cell in my range give a zero?
Arithmetic treats empty cells as zero. Filter out blanks first or test with IF before multiplying.
Does the array formula work in Excel for the web and mobile?
Dynamic arrays work in Excel for the web. The mobile apps can display spilled results, but building complex array formulas is easier on desktop because the formula bar is cramped on a phone.