Formula Errors

Find the Last Column with a Value Greater Than Zero in Excel

Elise WilliamsElise Williams Nov 27, 2026 869 views

Question details

Find the worksheet column number of the last cell containing a value greater than zero in a specified row.

Find the Last Column with a Value Greater Than Zero in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user needs to search cells AH3 through BH3 from left to right and identify the last column containing a positive number.
Observed behavior
The desired result is the worksheet column number of the rightmost positive numeric value in the specified range.
Before you start

Check the row and column range you want to search; the example uses AH3:BH3. The formula returns an absolute worksheet column number, not a position within the selected range.

Solution 1Recommended

Use LOOKUP to Find the Last Positive Value's Column

Use this formula to return the worksheet column number of the rightmost positive number, even if the values are not sorted.

The formula tests for positive numeric values and uses LOOKUP to find the last matching column. Unlike an approximate MATCH formula, it does not require the values to be sorted.

1
Select the result cell

Click an empty cell outside AH3:BH3 where you want the column number to appear.

2
Enter the formula

Type =LOOKUP(2,1/(ISNUMBER(AH3:BH3)*(AH3:BH3>0)),COLUMN(AH3:BH3)) and press Enter. Replace both instances of AH3:BH3 with your own single-row range if needed.

3
Check the result

Compare the returned number with the column containing the last positive value. For example, a result of 34 identifies column AH.

Use LOOKUP to Find the Last Positive Value's Column
If no positive value is found: The formula returns #N/A when the range contains no positive numeric values. To display a message instead, use =IFERROR(LOOKUP(2,1/(ISNUMBER(AH3:BH3)*(AH3:BH3>0)),COLUMN(AH3:BH3)),"No positive value").
Find the last positive value in WPS

Find the Last Positive Value's Column in WPS Spreadsheet

Use a LOOKUP formula in WPS Spreadsheet to identify the worksheet column number of the rightmost positive value in a row.

  1. 1. Open the spreadsheet: Open WPS Spreadsheet and select Open to load your workbook.
  2. 2. Choose a result cell: Click an empty cell outside the range you want to search.
  3. 3. Enter the formula: Type =LOOKUP(2,1/(ISNUMBER(AH3:BH3)*(AH3:BH3>0)),COLUMN(AH3:BH3)) and press Enter. Adjust the range to match your row.
  4. 4. Review the column number: Check the result against the rightmost positive value in the selected range. If your WPS version requires array-formula entry, select the formula cell and confirm it with Ctrl+Shift+Enter.
Find the last positive numeric value without sorting the row.Open and edit Microsoft Excel XLS and XLSX files.Use familiar spreadsheet formulas and cell references.Work with spreadsheets in a free Office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula return a worksheet column number or a position in the range?

It returns the worksheet column number. For example, AH is column 34, even though it is the first column in the example range.

What happens if the row contains no positive numbers?

LOOKUP returns #N/A. Wrap the formula in IFERROR, such as =IFERROR(your_formula,"No positive value"), to show a message instead.

Will zeros, negative values, or text count as matches?

No. The ISNUMBER test and the >0 condition limit matches to numeric values greater than zero.

Why might an approximate MATCH formula give an unreliable result?

Approximate MATCH expects sorted lookup values. If the row is unsorted, it may not identify the last qualifying cell; the LOOKUP formula above avoids that sorting requirement.