logo
search
Function Problems

How to Find the First Positive Value in a Row in Excel

Kushani NimanthikaKushani Nimanthika Oct 8, 2026 869 views

Question details

The user needs an Excel formula to identify the first cell in a row that contains a value greater than zero, and then retrieve the corresponding column header (such as a date) from the top row.

Excel Formula to Find the First Positive Value in a Row
Product
Excel
Device & OS
not provided
Scenario
Analyzing row-by-row data to determine the exact date or period when a value first becomes positive.
Observed behavior
Searching left to right across a specific row to return the exact header date of the first occurrence of a value >0 without returning approximate matches.
Before you start

Ensure your data range is contiguous and your header row is locked using absolute references (like $D$3:$H$3) so the formula can be copied down multiple rows without errors.

Solution 1Recommended

Use the INDEX and MATCH Array Formula

This method reliably evaluates each cell in a row to check if it is greater than zero, returning the first matching column header from left to right.

By combining INDEX and MATCH with an array logic, Excel can evaluate a condition (greater than zero) across multiple columns simultaneously.

1
Select the destination cell

Click on the cell where you want the corresponding date result to appear (for example, C4).

2
Enter the formula

Type the formula: =INDEX($D$3:$H$3, MATCH(TRUE, $D4:$H4>0, 0)) into the formula bar.

3
Execute the array formula

Press Ctrl+Shift+Enter to evaluate it as an array formula (newer Excel versions may only require pressing Enter). Curly braces {} will automatically appear around the formula.

4
Apply to other rows

Click and drag the fill handle at the bottom right of the cell down to apply the formula to the remaining rows in your dataset.

Use the INDEX and MATCH Array Formula
Regional Settings Requirement: If your computer's regional settings use semicolons instead of commas as list separators, adjust the formula to =INDEX($D$3:$H$3; MATCH(TRUE; $D4:$H4>0; 0)).
Advanced Spreadsheets

Use WPS Spreadsheet to Analyze Row Data

WPS Spreadsheet fully supports advanced array formulas like INDEX, MATCH, and XLOOKUP, making it incredibly easy to find the first positive values and extract corresponding headers from your datasets.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your existing Excel workbook (.xlsx).
  2. 2. Select your target cell: Click on the cell where you want to output the corresponding header date.
  3. 3. Input the array formula: Type =INDEX($D$3:$H$3, MATCH(TRUE, $D4:$H4>0, 0)) into the formula bar.
  4. 4. Calculate the result: Press Ctrl+Shift+Enter to complete the array calculation, then drag the cell downwards to fill the rest of your data.
Seamlessly execute complex array formulas to find the first positive values in any row.Fully compatible with Microsoft Excel (.xlsx) file formats and formulas.Free, lightweight, and features a highly familiar user interface for immediate productivity.
QA img-9

Frequently Asked Questions

Why does my INDEX and MATCH formula return an #N/A error?

This error occurs if no positive value (greater than zero) is found in the specified row range. You can wrap your formula in an IFERROR function to handle this gracefully. For example: =IFERROR(INDEX($D$3:$H$3, MATCH(TRUE, $D4:$H4>0, 0)), "No positive value").

Can I find the last positive value in a row instead of the first?

Yes. If you are using Microsoft 365, Excel 2021, or recent versions of WPS Office, you can use the XLOOKUP function with the search mode set to -1 (search last to first). The formula would be: =XLOOKUP(TRUE, D4:H4>0, D3:H3, "Not Found", 0, -1).

Do I always need to press Ctrl+Shift+Enter for the INDEX and MATCH formula?

In older versions of Excel (2019 and earlier) and older versions of spreadsheet software, Ctrl+Shift+Enter is required because it forces the program to evaluate the logic as an array formula. In newer versions that support dynamic arrays, simply pressing Enter is sufficient.