logo
search
Function Problems

How to Use Excel IF Formula to Return the First Nonblank Value

Elise WilliamsElise Williams Oct 19, 2026 869 views

Question details

The user needs to find a way to return the first nonblank value from a sequence of multiple cells using an IF formula.

How to Use an Excel IF Formula to Return the First Nonblank Value
Product
Excel
Device & OS
not provided
Scenario
Checking multiple cells, such as A2, B2, and C2, in a specific sequential order to retrieve the first available data entry.
Observed behavior
The formula must evaluate the cells one by one and return the value of the first cell that is not empty. If all evaluated cells are blank, it should return an empty string.
Before you start

Ensure your data is organized in adjacent columns or a predictable sequence, and identify the exact order of the cells you want to check for nonblank values.

Solution 1Recommended

Use a Nested IF Formula to Check Cells Sequentially

This is the most direct method to evaluate a specific number of cells and return the first one that contains data by layering IF functions.

A nested IF formula allows you to test multiple conditions in a specific order. By checking if a cell is not equal to blank, Excel will return that cell's value if true, or move to the next IF function if false.

1
Select the Target Cell

Click on the cell where you want the final result to appear, such as cell E2.

2
Enter the Nested IF Formula

Click into the formula bar at the top of the worksheet and type the following formula: =IF(A2<>"",A2,IF(B2<>"",B2,IF(C2<>"",C2,"")))

3
Apply the Formula

Press the Enter key on your keyboard. Excel will evaluate A2, then B2, then C2, and return the first value it finds.

4
Fill the Formula Down

Click the small square (fill handle) in the bottom-right corner of cell E2 and drag it down the column to apply this logic to the remaining rows in your dataset.

Use a Nested IF Formula to Check Cells Sequentially
Formula Logic Explained: In Excel formulas, the operator <>"" translates to 'is not equal to blank'. This allows the formula to skip any empty cells until it encounters a cell with actual data.
WPS Spreadsheet

Easily Manage Complex Formulas with WPS Spreadsheet

WPS Office provides a powerful, free alternative for spreadsheet management. You can effortlessly use nested IF functions, IFS, and other logical formulas just like you do in Excel, with full compatibility for your existing files.

  1. 1. Open WPS Spreadsheet: Launch WPS Office on your device and open your existing spreadsheet document.
  2. 2. Select the Destination Cell: Click on the cell where you want the first nonblank value to be displayed.
  3. 3. Input the Logical Formula: Type your nested IF formula into the formula bar, for example: =IF(A2<>"",A2,IF(B2<>"",B2,IF(C2<>"",C2,""))), and press Enter.
  4. 4. Drag to Fill: Double-click or drag the fill handle at the bottom-right of the cell to copy the formula down to the rest of your data.
Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formats.Supports all standard logical functions including IF, IFS, and XLOOKUP.Lightweight and fast, even with complex datasets and heavily nested formulas.Free to use with an intuitive, familiar user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use the IFS function instead of a nested IF formula?

Yes. If you are using a newer version of Excel or WPS Spreadsheet, you can use the IFS function to avoid multiple nesting. The equivalent formula would be =IFS(A2<>"",A2, B2<>"",B2, C2<>"",C2, TRUE,"").

What if my cells contain spaces instead of being completely blank?

If your cells contain hidden spaces, the formula will treat them as nonblank. To fix this, you can wrap the cell reference in the TRIM function, like this: =IF(TRIM(A2)<>"",A2, IF(TRIM(B2)<>"",B2...)).

How can I check a large range of cells for the first nonblank value?

For larger ranges where nested IFs become too long, you can use a combination of INDEX and MATCH. An array formula such as =INDEX(A2:Z2, MATCH(FALSE, ISBLANK(A2:Z2), 0)) will find the first nonblank value in a continuous range.