Excel Error Codes

Fix an Excel #SPILL Error in a Table Using XLOOKUP

Huda QurayshiHuda Qurayshi Nov 18, 2026 872 views

Question details

Return the matching local administrator from another table without spilling an entire column into an Excel table.

Fix an Excel #SPILL Error in a Table Using XLOOKUP
Product
Microsoft Excel
Device & OS
not provided
Scenario
A calculated table column needs to find an administrator for the current facility where WOAR equals 1.
Observed behavior
The formula returns the entire Local Administrator column and produces a #SPILL error inside the table.
Before you start

Check the table and column names on the Table Design tab, and confirm that your Excel version supports XLOOKUP. The examples assume the source table is named TableB and its WOAR values are numeric.

Solution 1Recommended

Return one matching administrator with XLOOKUP

Replace the whole-column result with a lookup that returns a single value for the current row.

1
Select the calculated column

Click the cell in the destination table that currently contains the #SPILL formula.

2
Enter the lookup formula

In the formula bar, enter =XLOOKUP([@Facility]&1,TableB[Facility]&TableB[WOAR],TableB[Local Administrator],"") and press Enter.

3
Check the column references

If your fields use different names, replace [@Facility] and TableB[Facility] with the corresponding destination and source columns. For example, use [@[office.y]] and TableB[Name] if those are the matching fields.

4
Verify the result

Check that the calculated column displays the first matching administrator for each row. A blank result means no matching facility and WOAR value of 1 was found.

Return one matching administrator with XLOOKUP
Why the error occurs: Returning TableB[Local Administrator] directly can produce an array of values. Excel tables cannot contain spilled array formulas, while this XLOOKUP returns one matching value.
Free Microsoft Office alternative

Work with Excel spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Excel workbooks. Move existing files into WPS Spreadsheets and check formula compatibility before relying on the results.

Open and edit Microsoft Excel XLSX and XLS filesReview administrator lookup data in WPS SpreadsheetsUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula spill inside an Excel table?

A formula that returns TableB[Local Administrator] directly can return the entire column. Excel tables do not support spilled array formulas, so use XLOOKUP to return one matching value per row.

What happens if more than one row matches?

By default, XLOOKUP returns the first match in the lookup array. Check TableB for duplicate facility and WOAR combinations if you expect only one administrator.

Why does XLOOKUP return a blank?

The final empty-string argument tells XLOOKUP to return a blank when no match is found. Compare the facility names and WOAR values in both tables, including spaces and data types.

Can I use this formula in an older version of Excel?

XLOOKUP is available in Microsoft 365 and newer versions such as Excel 2021 and 2024, but not in Excel 2016 or 2019. Check your version under File > Account.