How to Keep XLOOKUP Table References Fixed When Dragging Formulas
Question details
The user needs to prevent XLOOKUP table column references from shifting to unintended columns when copying or dragging the formula horizontally.

- 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.
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).
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.
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.
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]].
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.
Combine the components: =XLOOKUP($A2, Live[[Code]:[Code]], INDEX(Live, 0, MATCH(C$1, Live[#Headers], 0))).
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 Absolute Structured References
If you are returning data from a single, unchanging column and just want to stop the reference from moving, you can duplicate the column name in brackets to make it absolute.
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. Open your file in WPS Spreadsheet: Launch WPS Office and open your .xlsx workbook containing the dataset.
- 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. 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. 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.

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.




