Function Problems

Return the First Positive Value's Date With an Excel Formula

Nimra MalikNimra Malik Nov 18, 2026 868 views

Question details

Find the first value greater than zero across a row and return the corresponding date from another row without nested IF statements.

Return the First Positive Value's Date With an Excel Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
A row of formula results is aligned by column with a row of dates.
Observed behavior
The desired result is the date in the first column where the formula result is positive.
Before you start

Check that the values in B50:CM50 are numeric results and that B41:CM41 contains the corresponding dates in the same columns. Choose an empty cell for the result and confirm which Excel version you use.

Solution 1Recommended

Use XLOOKUP to return the date of the first positive value

Use this formula in Microsoft 365 or Excel 2021 to return one matching date or a blank if there is no match.

1
Enter the lookup formula

Select an empty cell and enter =XLOOKUP(TRUE,B50:CM50>0,B41:CM41,"",0).

2
Format the result as a date

Press Enter, then select the result cell and choose a date format from Home > Number if it displays as a serial number.

Use XLOOKUP to return the date of the first positive value
How the match works: XLOOKUP checks the values from left to right and returns the date aligned with the first value greater than zero. If none is found, the formula returns a blank.
Work with spreadsheet formulas in WPS

Find the first positive value's date in WPS Spreadsheets

Use an INDEX and MATCH array formula in WPS Spreadsheets to return the date aligned with the first positive result in a row.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Check the ranges: Verify that B50:CM50 contains the results and B41:CM41 contains the corresponding dates, or adjust the ranges to match your sheet.
  3. 3. Enter the formula: Select an empty cell and enter =INDEX(B41:CM41,1,MATCH(TRUE,B50:CM50>0,0)). Press Enter, or use Ctrl+Shift+Enter if your version requires array-formula confirmation.
  4. 4. Format the date: Select the result cell and choose a date format from the Home tab's number-format controls if the result appears as a number.
Find a matching date without nested IF statementsOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting controlsWork with a free office suite
QA img-9

Frequently Asked Questions

What happens if there are no positive values?

The XLOOKUP formula returns a blank because its fourth argument is "". The INDEX and MATCH formula returns #N/A unless you handle the error, for example with IFERROR.

Why does the date appear as a number?

Excel stores dates as serial numbers. Select the result cell and choose a date format from Home > Number.

Why do I see a #SPILL! error?

A direct comparison such as B50:CM50>0 can return an array that needs space in adjacent cells. Use the XLOOKUP or INDEX and MATCH formula to return a single date; if another formula must spill, clear its intended output range.

Can I use different rows or columns?

Yes. Replace B50:CM50 with your value range and B41:CM41 with your date range. Keep the ranges the same width and align each date with its value.

Does zero count as a positive value?

No. The condition >0 excludes zero. Change it to >=0 in the formula if you want to include zero.