Find the First Nonblank Cell in an Excel Row While Skipping a Value
Question details
Find the first cell in a horizontal range that is not blank and does not equal a specified value.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Search a row from left to right, skipping blank cells and cells containing the excluded value A.
- Observed behavior
- The formula should return the first qualifying cell value in the range.
Identify the worksheet and horizontal range to search, along with the exact value to exclude. The examples below search Tab!A7:L7 and skip cells equal to A.
Use INDEX and MATCH to Skip Blanks and an Excluded Value
Use this formula to return the first qualifying value from a row, including cells with formulas that return an empty string among the blanks to skip.
MATCH finds the first position where both conditions are true, and INDEX returns the value at that position. The comparison excludes cells equal to A, not cells that merely contain A as part of longer text.
Click an empty cell outside Tab!A7:L7 where you want the result to appear.
Type =INDEX(Tab!A7:L7,1,MATCH(1,(Tab!A7:L7<>"")*(Tab!A7:L7<>"A"),0)) in the selected cell.
Press Enter in Microsoft 365. In older Excel versions, press Ctrl+Shift+Enter to enter it as an array formula.
Replace Tab!A7:L7 and "A" with your range and excluded value. To also skip B, add *(Tab!A7:L7<>"B") after the A condition inside MATCH.

Find the First Eligible Value in WPS Spreadsheet
Use INDEX and MATCH in WPS Spreadsheet to search a row from left to right while skipping blank cells and a specified value.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
- 2. Choose a result cell: Click an empty cell outside the row you want to search.
- 3. Enter the formula: Type =INDEX(Tab!A7:L7,1,MATCH(1,(Tab!A7:L7<>"")*(Tab!A7:L7<>"A"),0)) and replace the range or excluded value as needed.
- 4. Confirm and save: Press Enter to calculate the result; if your WPS version requires array entry, use Ctrl+Shift+Enter. Select Save to keep the formula in the workbook.

Frequently Asked Questions
How do I skip more than one value?
Add another condition inside MATCH for each value. For example, append *(Tab!A7:L7<>"B") after the condition that excludes A.
Does the formula skip cells containing only spaces?
No. A cell containing spaces is not considered blank by the <>"" condition. Remove unwanted spaces from the source cells before using the formula if they should be treated as blank.
Why does the formula return #N/A?
There may be no cell in the selected range that meets both conditions. Check the range and excluded value, or wrap the formula in IFERROR to display a different result.
Does excluding A also exclude words that contain A?
No. The condition <>"A" excludes cells whose entire value equals A; it does not exclude longer text containing that letter.




