VLOOKUP #SPILL! error: how to fix it
Updated · Checked on a live sheet · Excel and Google Sheets
The most likely fix
A VLOOKUP whose lookup value is a range spills one result per value. If that range is a whole column, or a cell below is in use, you get #SPILL!. Look up only the cells you need (A2:A7), or use the value on the same row and fill down.
Fix it yourself
The formula in D2 shows the problem. Edit it to the fixed version and watch the sheet recalculate.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | SKU | Qty | Product | SKU | Product | Price | Stock | ||
| 2 | 2001 | PL-104 | 2 | #SPILL! | PL-101 | Fern | $9.50 | 40 | ||
| 3 | 2002 | PT-210 | 1 | PL-104 | Monstera | $34.00 | 12 | |||
| 4 | 2003 | TL-301 | 3 | PL-107 | Snake plant | $22.00 | 25 | |||
| 5 | 2004 | PL-101 | 1 | note | PT-210 | Terracotta pot | $12.50 | 60 | ||
| 6 | 2005 | SL-401 | 4 | PT-212 | Ceramic pot | $19.00 | 18 | |||
| 7 | 2006 | PL-104 | 1 | TL-301 | Watering can | $18.00 | 9 | |||
| 8 | 2007 | PT-212 | 2 | SL-401 | Potting mix | $7.25 | 80 | |||
| 9 | 2008 | PL-107 | 1 |
Shows the problem
=VLOOKUP(B2:B9,$G$2:$H$8,2,FALSE)Fixed
=VLOOKUP(B2,$G$2:$H$8,2,FALSE)Causes, most likely first
1The lookup value is a whole column
Microsoft's #SPILL! page uses this exact case: placed in E2,
=VLOOKUP(A:A,A:C,2,FALSE)used to look up only A2, but in dynamic-array Excel it looks up the entire column, returns 1,048,576 results and hits the end of the grid. Older workbooks often contain it.Wrong
=VLOOKUP(A:A,A:C,2,FALSE)Fixed
=VLOOKUP(A2:A7,A:C,2,FALSE)2Something blocks the results
A bounded lookup range spills one result per value, so it needs that many empty cells below. In the sheet above a note in D5 is in the way. Delete it, or switch to the fill-down version.
Wrong
=VLOOKUP(B2:B9,$G$2:$H$8,2,FALSE)Fixed
=VLOOKUP(B2,$G$2:$H$8,2,FALSE)3Which of Microsoft's three fixes to use
Reference only the lookup values (
A2:A7): one formula, a dynamic array, but not inside Excel tables. Reference the value on the same row (A2) and copy down: works in tables, no spill. Or ask for the old behaviour with@A:Aand copy down: also works in tables. Choose the first outside tables and the second inside them;@is mostly for fixing old files without rewriting them.Wrong
=VLOOKUP(A:A,A:C,2,FALSE)Fixed
=VLOOKUP(@A:A,A:C,2,FALSE)4The formula is in a table
Spilled array formulas aren't supported in Excel tables, so any version that spills shows #SPILL! there. Use the same-row version, or move the formula out of the table (Table Design › Tools › Convert to range turns the table into a normal range).
5XLOOKUP and other lookups spill too
The same rules apply to XLOOKUP, INDEX/MATCH and HLOOKUP: give them a range of lookup values and they return one result per value. A whole-column lookup value in any of them hits the edge of the sheet the same way.
Wrong
=XLOOKUP(A:A,G:G,H:H)Fixed
=XLOOKUP(A2:A7,G:G,H:H)
Stop it happening again
For new formulas, decide up front: a bounded range for one spilling lookup (outside tables), or the same-row lookup filled down (inside tables and in files shared with older Excel versions). Avoid whole-column lookup values entirely. Keep the cells below a spilling formula empty, and give each spilled result room to grow. When you inherit an old workbook that suddenly shows #SPILL!, adding @ in front of the whole-column reference restores the old behaviour quickly, and you can rewrite it properly later. XLOOKUP spills the same way, so the same rules apply.
Questions
What does the @ in a formula mean?
It's the implicit intersection operator: it asks Excel for a single value from a range, the old behaviour. Microsoft's #SPILL! page offers it as one of the three fixes for whole-column lookups, to be copied down like a classic formula.
Can one VLOOKUP return a whole column of results on purpose?
Yes: give it a bounded range of lookup values, like VLOOKUP(B2:B9, $G$2:$H$8, 2, FALSE), with empty cells below it. That's a single formula for the whole column, and it updates when the keys change.
In Google Sheets
Google Sheets doesn't use #SPILL! (it isn't in the list of error values in Google's ERROR.TYPE help), and we haven't found an official Google page on how a VLOOKUP with a range as its search key behaves there. The same-row version filled down works in both apps, which makes it the safest choice for shared files.
Why this happens
Before dynamic arrays, Excel silently used only the value on the formula's own row when a function expected one value but got a column (implicit intersection). Dynamic-array Excel returns all of them instead, which is powerful for bounded ranges and a #SPILL! for whole columns. The #SPILL! error page lists every cause; the VLOOKUP vs XLOOKUP guide covers lookups in general.
Sources
Official documentation the facts on this page were checked against.