Function Problems

How to Return the Last Nonblank Value from an Excel Table Column

Bushra ParveenBushra Parveen Nov 10, 2026 868 views

Question details

The user needs to retrieve the last non-empty value from a specific column within an Excel table located on a different worksheet.

How to Return the Last Nonblank Value from an Excel Table Column
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Using an XLOOKUP formula to dynamically pull the last running total from a formatted data table onto a separate reporting worksheet.
Observed behavior
The formula successfully calculates on the source sheet but returns a range-reference error when entered on another worksheet.
Before you start

Ensure your dataset is formatted as an official Table (Insert > Table) and verify the exact spelling of both your Table Name (e.g., TblData) and Column Header to ensure structured references work across sheets.

Solution 1Recommended

Use XLOOKUP with Structured References (Recommended)

This method works universally for both text and numeric values by forcing XLOOKUP to search the table column from bottom to top, bypassing sheet-specific reference errors.

Structured references allow you to call a table and its columns by name from anywhere in the workbook, preventing the typical #REF! errors associated with cross-sheet formulas.

1
Select Destination Cell

Navigate to the worksheet where you want to display the final result and select an empty cell.

2
Input the XLOOKUP Formula

Type the formula: =XLOOKUP(TRUE,TblData[Running Total]<>"",TblData[Running Total],"",0,-1)

3
Confirm Calculation

Press Enter. Ensure you replace 'TblData' and 'Running Total' with your actual table and column names.

Use XLOOKUP with Structured References (Recommended)
Understanding the Reverse Search: The '-1' at the very end of this XLOOKUP formula commands the function to search from last-to-first (bottom-to-top), which ensures you capture the very last entry rather than the first one.
Professional Spreadsheet Software

Easily Manage Table References and Advanced Formulas with WPS Spreadsheet

WPS Spreadsheet offers powerful, built-in support for advanced functions like XLOOKUP, LOOKUP, and structured table referencing. Effortlessly manage large datasets and pull cross-sheet data without frustrating reference errors.

  1. 1. Open your Dataset: Launch WPS Spreadsheet and open your existing workbook.
  2. 2. Format as Table: Select your data range and press Ctrl+T to convert it into a designated Table, enabling global workbook references.
  3. 3. Insert XLOOKUP: Use WPS's intelligent formula builder to seamlessly insert your XLOOKUP function on any sheet.
100% compatible with Microsoft Excel formulas, tables, and structured references.Supports modern XLOOKUP syntax including reverse search and array handling.Intelligent formula autocomplete helps prevent syntax and spelling errors.Free, lightweight, and fast-loading alternative for data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula return a #REF! error when copied to another sheet?

A #REF! error usually happens if you are using standard cell references (like A2:A100) instead of global structured references, and the sheet name isn't properly included. By formatting your data as a Table and using TableName[ColumnName], the formula dynamically recognizes the data from any worksheet in the file.

Can I use the LOOKUP(9^99) method if my column contains text?

No, the =LOOKUP(9^99, range) method only works for finding the last numeric value. If your column contains text, or a mix of text and numbers, you should use the XLOOKUP method instead.

What does the <>"" part of the XLOOKUP formula do?

The <>"" is a logical operator in Excel that means "is not equal to blank". In the XLOOKUP formula, it acts as the lookup array criteria, scanning the table column specifically to identify cells that actually contain data.