How to Use Excel IF Formula to Return the First Nonblank Value
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.

- 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.
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.
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.
Click on the cell where you want the final result to appear, such as cell E2.
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,"")))
Press the Enter key on your keyboard. Excel will evaluate A2, then B2, then C2, and return the first value it finds.
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.

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. Open WPS Spreadsheet: Launch WPS Office on your device and open your existing spreadsheet document.
- 2. Select the Destination Cell: Click on the cell where you want the first nonblank value to be displayed.
- 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. 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.

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.




