# How to find the first non-blank value in a row in Excel

Look for the first TRUE in a "not empty" test: `=XLOOKUP(TRUE,B2:F2<>"",B2:F2)`, filled down.

**Excel:** `=XLOOKUP(TRUE,B2:F2<>"",B2:F2)` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G |
| --- | --- | --- | --- | --- | --- | --- |
| Store | Jan | Feb | Mar | Apr | May | First month sales |
| Austin | 18400 | 21950 | 23100 | 24800 | 26350 |  |
| Boise |  |  | 9800 | 12450 | 14100 |  |
| Denver |  | 15200 | 17650 | 18900 | 20300 |  |
| Omaha |  |  |  |  | 8650 |  |
| Tulsa | 11300 | 12100 |  | 13750 | 14600 |  |

Formula in G2, filled to G6: `=XLOOKUP(TRUE,B2:F2<>"",B2:F2)`

Result: $18,400; $9,800; $15,200; $8,650; $11,300

## How it works

`B2:F2<>""` turns the row into TRUE and FALSE values, one per month. XLOOKUP finds the first TRUE from the left and returns the sales in the same position: Boise's first sales are in March, 9,800.

## Other ways

- `=INDEX(B2:F2,MATCH(TRUE,INDEX(B2:F2<>"",0),0))`: Works in every Excel version without Ctrl+Shift+Enter: the inner INDEX(…,0) makes the test work as an array.

## Common mistakes

- A formula that returns "" counts as blank in this test, which is usually what you want. A cell with a space does not.
- Zeros are not blank. To skip zeros too, test `(B2:F2<>"")*(B2:F2<>0)` and look for 1.

## Questions

**How do I return the month instead of the value?**

Return the header row: `=XLOOKUP(TRUE,B2:F2<>"",B$1:F$1)`.

**How do I find the first non-blank value in a column?**

The same formula on a column range: `=XLOOKUP(TRUE,A2:A20<>"",A2:A20)`.

**How do I return the first of several phone columns that is filled?**

That is the same pattern: `=XLOOKUP(TRUE,B2:D2<>"",B2:D2,"No number")` picks mobile, then work, then home.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/first-non-blank-value-in-row
