Function Problems

How to Keep XLOOKUP Table References Fixed When Dragging Formulas

Elise WilliamsElise Williams Nov 10, 2026 868 views

Question details

The user needs to prevent XLOOKUP table column references from shifting to unintended columns when copying or dragging the formula horizontally.

How to Keep XLOOKUP Table References Fixed When Dragging Formulas
Product
Spreadsheet
Device & OS
not provided
Scenario
Dragging an XLOOKUP formula horizontally across multiple columns while referencing a formatted table.
Observed behavior
When the XLOOKUP formula is dragged horizontally, the structured references for the lookup array or return array dynamically shift relative to the drag direction, causing incorrect data lookups or #REF! errors.
Before you start

Ensure your source data is formatted as an official Table and that you know the exact names of your target columns and headers. Familiarize yourself with how structured references behave differently from standard absolute cell references (like $A$1).

Solution 1Recommended

Use INDEX and MATCH to Lock the Return Array Dynamically

By nesting INDEX and MATCH within your XLOOKUP formula, you can precisely anchor the return array based on a specific column header without it shifting when dragged horizontally.

Structured references (like TableName[ColumnName]) naturally shift when dragged across columns. To bypass this, we can use the INDEX function to define the entire table as the return array, and the MATCH function to find the exact column we want to return data from.

1
Pin the lookup value

Start your XLOOKUP formula by locking the column of your lookup value using a mixed cell reference, such as =XLOOKUP($A2, ...). This ensures the formula always looks at column A even when dragged to the right.

2
Set the fixed lookup array

Reference the specific table column for the lookup array. If you need it completely static, you can use the double-bracket syntax: Live[[Code]:[Code]].

3
Build the dynamic return array with INDEX

Use INDEX and MATCH to dynamically locate the correct return column based on a top-row header. For example: INDEX(Live, 0, MATCH(C$1, Live[#Headers], 0)). This tells the formula to look at the entire 'Live' table, return all rows (0), and match the column header found in C$1.

4
Assemble the complete formula

Combine the components: =XLOOKUP($A2, Live[[Code]:[Code]], INDEX(Live, 0, MATCH(C$1, Live[#Headers], 0))).

5
Drag the formula across columns

Select the cell containing your completed formula, click the fill handle in the bottom right corner, and drag it horizontally. The lookup column stays fixed, while the return column correctly adapts to the new headers.

Use INDEX and MATCH to Lock the Return Array Dynamically
Pro Tip: Using a mixed reference for the header (like C$1) ensures that when you drag the formula down, the row stays locked to the header row, but when dragged right, it updates to D$1, E$1, etc.
Master Formulas with WPS Spreadsheet

Easily Manage Complex XLOOKUP Formulas in WPS Office

WPS Spreadsheet fully supports advanced modern functions like XLOOKUP, dynamic arrays, and structured table references. You can manage massive datasets efficiently without worrying about formula errors, all within a familiar interface.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your .xlsx workbook containing the dataset.
  2. 2. Format as a Table: Select your data range and press Ctrl+T to convert it into a structured Table for easier formula management.
  3. 3. Enter your XLOOKUP formula: Type =XLOOKUP( and use WPS Spreadsheet's intelligent formula prompts to insert your absolute structured references or INDEX/MATCH combinations.
  4. 4. Use the Fill Handle: Click and drag the green square at the bottom-right of your cell to quickly fill the formula across your desired columns and rows.
Seamless compatibility with Microsoft Excel formulas and table formats (.xlsx).Built-in formula error checking and auto-completion for functions like XLOOKUP, INDEX, and MATCH.Lightweight, fast performance for handling large datasets smoothly.Completely free to use for personal document management and data analysis.
microsoft office alternative - wps office

Frequently Asked Questions

Why do structured references change when I drag formulas horizontally?

By default, spreadsheet applications treat standard structured references (like Table1[ColumnA]) as relative references when dragged horizontally across columns. This is designed to help auto-fill related data, but it can cause issues if you want to lock the reference to a single column.

Can I just copy and paste the formula instead of dragging it?

Yes. If you copy the actual text of the formula from the formula bar (rather than copying the cell itself) and paste it into another cell, the structured references will not shift.

Is XLOOKUP fully supported in WPS Office?

Yes, XLOOKUP is natively supported in the latest versions of WPS Spreadsheet, allowing you to perform exact matches, wildcards, and reverse searches seamlessly, maintaining full compatibility with Excel files.

What happens if my XLOOKUP returns a #REF! error after dragging?

A #REF! error usually means the return array or lookup array has shifted outside the boundaries of your worksheet or the referenced table. Check your formula to ensure your references are properly anchored using absolute syntax or INDEX/MATCH functions.