Function Problems

How to Return the Rightmost Nonblank Price for Today's Date in Excel

Adam DavisAdam Davis Nov 11, 2026 871 views

Question details

The user needs to find rows corresponding to today's date and extract the last (rightmost) nonblank price from a horizontal array.

How to Return the Rightmost Nonblank Price for Today's Date in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking daily financial data where prices are entered horizontally over time, and the user needs to isolate today's records and retrieve the latest valid price entry to calculate a SUM.
Observed behavior
Requires a dynamic formula that filters dates to match TODAY() and processes the corresponding horizontal price array to locate the final non-empty cell.
Before you start

Verify that the dates in your first column are formatted as valid date values, not text. Ensure you are using a software version that supports the LET function and Dynamic Arrays, such as Microsoft 365, Excel 2021, or the latest version of WPS Office.

Solution 1Recommended

Use a LET and BYROW Dynamic Array Formula

Combine LET, FILTER, BYROW, and XLOOKUP to build a single dynamic formula that accurately filters today's records and extracts the last entered price.

By utilizing the LET function, you can declare your date and price ranges upfront, making the formula easier to read and modify.

The FILTER function isolates the rows corresponding to today's date, while BYROW and XLOOKUP efficiently scan each isolated row from right to left to locate the final nonblank cell.

1
Select the target cell

Click on the cell where you want the resulting array of rightmost prices to spill.

2
Input the LET function

Start your formula by typing =LET(dates, A2:A100, prices, B2:Z100, ... to define the ranges for your date column and your horizontal price matrix.

3
Filter for today's date

Define a variable inside LET to filter the dataset: todays_prices, FILTER(prices, dates=TODAY()).

4
Extract the rightmost value

Add the final calculation using BYROW and XLOOKUP: BYROW(todays_prices, LAMBDA(row, XLOOKUP(TRUE, row<>"", row, "", 0, -1)))).

5
Finalize and execute

Your complete formula should look like: =LET(dates, A2:A100, prices, B2:Z100, todays_prices, FILTER(prices, dates=TODAY()), BYROW(todays_prices, LAMBDA(row, XLOOKUP(TRUE, row<>"", row, "", 0, -1)))). Press Enter to apply.

Use a LET and BYROW Dynamic Array Formula
Summing the Results: You can wrap the entire LET function inside a SUM() function if you want to immediately calculate the total of the retrieved rightmost prices rather than displaying them.
Solve complex formulas effortlessly

Use WPS Spreadsheet for Advanced Dynamic Arrays

WPS Spreadsheet fully supports advanced dynamic array functions like LET, BYROW, LAMBDA, and XLOOKUP, allowing you to instantly extract nonblank daily prices just like in Excel.

  1. 1. Open your dataset in WPS: Launch WPS Spreadsheet and open your existing financial tracking workbook.
  2. 2. Select the destination cell: Click on the cell where the price array or SUM total should be displayed.
  3. 3. Enter the dynamic formula: Type the exact LET formula mentioned above, as WPS syntax is identical to Excel's.
  4. 4. Press Enter to execute: Hit Enter, and WPS Spreadsheet will automatically spill the array of the rightmost nonblank prices for today.
100% compatible with Microsoft Excel (.xlsx) formats and advanced formula syntaxNative support for LET, FILTER, and dynamic spilling arraysFree to use with a lightweight, user-friendly interfaceBuilt-in data analysis tools to track and sum financial records easily
microsoft office alternative - wps office

Frequently Asked Questions

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

This error occurs if your spreadsheet software does not support the LET or BYROW functions. Ensure you are using an updated version like Microsoft 365, Excel 2021, or the latest release of WPS Office.

How do I modify the formula to check for yesterday's prices?

You can change the condition in your FILTER statement. Replace dates=TODAY() with dates=TODAY()-1 to filter rows corresponding to the previous day.

What happens if there are no records for today's date?

The FILTER function will return a #CALC! error. You can prevent this by adding the optional 'if_empty' argument to the FILTER function, such as FILTER(prices, dates=TODAY(), "No data").

Can I use this formula to retrieve text values instead of numbers?

Yes. Since the logic relies on checking for nonblank cells (<>""), it will successfully return the rightmost text string or numeric price, depending on what is entered in the cells.