How to Return the Rightmost Nonblank Price for Today's Date in Excel
Question details
The user needs to find rows corresponding to today's date and extract the last (rightmost) nonblank price from a horizontal array.

- 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.
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.
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.
Click on the cell where you want the resulting array of rightmost prices to spill.
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.
Define a variable inside LET to filter the dataset: todays_prices, FILTER(prices, dates=TODAY()).
Add the final calculation using BYROW and XLOOKUP: BYROW(todays_prices, LAMBDA(row, XLOOKUP(TRUE, row<>"", row, "", 0, -1)))).
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 an Alternative FILTER and LOOKUP Approach
If you prefer traditional lookup methods within a dynamic array, you can use the classic LOOKUP(2, 1/(range<>""), range) logic inside a LAMBDA function.
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. Open your dataset in WPS: Launch WPS Spreadsheet and open your existing financial tracking workbook.
- 2. Select the destination cell: Click on the cell where the price array or SUM total should be displayed.
- 3. Enter the dynamic formula: Type the exact LET formula mentioned above, as WPS syntax is identical to Excel's.
- 4. Press Enter to execute: Hit Enter, and WPS Spreadsheet will automatically spill the array of the rightmost nonblank prices for today.

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.




