Function Problems

Find the First Excel Row Where a Value Is Zero or Less

Chanuka GeekiyanageChanuka Geekiyanage Dec 2, 2026 868 views

Question details

Return the column B value corresponding to the first value in a 400-cell column H range that is zero or less.

Find the First Excel Row Where a Value Is Zero or Less
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains values in H6:H405 and corresponding results in B6:B405.
Observed behavior
The desired result is the column B value on the first row, from top to bottom, where column H contains a nonblank value equal to or less than zero.
Before you start

Check that H6:H405 contains numeric values and that B6:B405 covers the corresponding rows. Choose an empty cell outside those ranges for the formula.

Solution 1Recommended

Use XLOOKUP to return the first matching value

Use this formula in an Excel version that supports XLOOKUP; the data does not need to be sorted.

1
Select an output cell

Click an empty cell where you want the column B result to appear.

2
Enter the formula

Type =XLOOKUP(1,(H6:H405<>"")*(H6:H405<=0),B6:B405,"Not found") and press Enter.

3
Check the result

Compare the result with column B on the first row where column H is zero or negative. If no nonblank value qualifies, the cell displays Not found.

Use XLOOKUP to return the first matching value
Keep the ranges aligned: If your data is on another sheet, add the sheet reference to both ranges, for example Sheet1!H6:H405 and Sheet1!B6:B405.
Find matching values in WPS Spreadsheets

Find the first zero or negative value in WPS Spreadsheets

Use INDEX and MATCH in WPS Spreadsheets to find the first nonblank value in column H that is zero or less and return its corresponding value from column B.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Check the ranges: Locate H6:H405 and B6:B405 on the worksheet, and confirm that the rows correspond.
  3. 3. Enter the formula: Click an empty cell and enter =IFERROR(INDEX(B6:B405,MATCH(1,INDEX((H6:H405<>"")*(H6:H405<=0),0),0)),"Not found").
  4. 4. Review the result: Press Enter and check that the returned column B value belongs to the first row with a nonblank column H value of zero or less.
Find the first qualifying value without sorting the rangeOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and controlsWork with a free, easy-to-use office suite
microsoft office alternative - wps office

Frequently Asked Questions

Does the range need to be sorted?

No. The XLOOKUP and INDEX/MATCH formulas scan the specified range from top to bottom and return the first qualifying row.

Will a blank cell in column H count as zero?

The formulas exclude blank cells using H6:H405<>"", so a blank cell will not be selected as the first match.

How can I return the worksheet row number instead of the column B value?

In a cell, enter =XLOOKUP(1,(H6:H405<>"")*(H6:H405<=0),ROW(H6:H405),"Not found") in an Excel version that supports XLOOKUP.

Why is the formula showing Not found?

Check H6:H405 for a nonblank numeric value of zero or less. If you use the IFERROR formula, also check the references and source values because IFERROR can hide other errors.