Function Problems

Excel INDEX MATCH Alternative: Return a GL Code Using XLOOKUP

Elise WilliamsElise Williams Nov 11, 2026 869 views

Question details

The user wants to match a category on one worksheet with a category list on another worksheet to retrieve the corresponding GL code, looking for a simpler alternative to the complex INDEX MATCH formula.

How to Return a GL Code Using XLOOKUP as an INDEX MATCH Alternative
Product
Excel
Device & OS
not provided
Scenario
Looking up and returning specific financial data (GL codes) from another worksheet based on corresponding category matches.
Observed behavior
Needs an efficient formula, such as XLOOKUP, to handle cross-sheet data retrieval without encountering the syntax complexities of traditional lookup methods.
Before you start

Ensure both your main worksheet and the reference worksheet containing the GL codes are open, and format your reference data as a Table (e.g., TableGL) to make writing the formula easier and more dynamic.

Solution 1Recommended

Use XLOOKUP to Retrieve the GL Code

XLOOKUP is a modern, straightforward alternative to INDEX MATCH that allows you to easily search for a category and return its corresponding GL code from another sheet or table.

XLOOKUP simplifies the lookup process by only requiring you to specify what you are looking for, where to look, and what to return. It also has built-in error handling for missing values.

1
Select the target cell

Click on the cell in your main worksheet where you want the GL code to be displayed.

2
Enter the XLOOKUP formula

Type the formula: =IF(C2="","",XLOOKUP(C2,TableGL[CATEGORY],TableGL[GL CODE],"No match")). Replace 'C2' with the cell containing your lookup category.

3
Apply structured references

If your source data is formatted as a table, use the structured reference for the category column (like TableGL[CATEGORY]) instead of a standard cell range. Press Enter to apply.

Use XLOOKUP to Retrieve the GL Code
Handling Empty Cells: The IF(C2="","",...) portion of the formula ensures that if the category cell is blank, the formula returns a clean blank cell instead of attempting a lookup.
Powerful Spreadsheet Data Analysis

Use XLOOKUP and Advanced Formulas in WPS Spreadsheet

WPS Spreadsheet fully supports advanced modern Excel functions, including XLOOKUP, making cross-sheet data retrieval and financial tracking effortless and fast.

  1. 1. Open your workbook in WPS: Launch WPS Office and open your spreadsheet file containing the category list and GL code sheets.
  2. 2. Format data as a Table: Select your GL code reference range, navigate to the Home tab, and click 'Format as Table' to easily name your ranges.
  3. 3. Insert the XLOOKUP formula: In your main sheet, type =XLOOKUP() and use the intuitive tooltip guide to select your lookup value, lookup array, and return array.
  4. 4. Drag to fill: Click the small square at the bottom-right of the active cell and drag down to apply the formula to the rest of the column.
Fully compatible with Microsoft Excel formulas including XLOOKUP, VLOOKUP, and INDEX MATCH.Free and lightweight alternative for processing large financial datasets without lag.Built-in Table formatting and structured referencing for easier formula writing.Familiar user interface makes transitioning from Excel completely seamless.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my XLOOKUP formula return a #NAME? error?

This error usually occurs if you are using an older version of Excel that does not support the XLOOKUP function. In this case, use the traditional INDEX MATCH combination instead, or switch to a modern spreadsheet software like WPS Office.

What is the advantage of XLOOKUP over INDEX MATCH?

XLOOKUP is much simpler to write and read. It automatically allows you to specify a 'not found' message directly within the formula without needing an extra IFERROR function, and it defaults to exact matches, unlike older lookup formulas.

Can I use XLOOKUP to return multiple columns at once?

Yes, if you select multiple adjacent columns as your return array (for example, returning both the GL Code and the Account Description), XLOOKUP will automatically spill the results into the adjacent cells.