which returns a value from the first non-blank cell, B5, C5, D5, or E5, respectively. When all cells are blank, the formula returns “no value”. The value returned when all cells are blank can be adjusted as desired. This expression is used four times in the formula shown in the example, in order to test four different cells in a particular order. The overall structure of this formula is what is called a “nested IF formula”. Each IF statement checks a cell to see if it not empty. If not empty, the IF returns the value from that cell. If the cell is empty, the IF statement hands off processing to another IF statement: The flow of a nested IF is easier to visualize if you add line breaks to the formula. Below, line breaks have been added to the formula to line up the IF statements:

With ISBLANK

Excel contains the ISBLANK function, which returns TRUE when a cell is blank: The behavior can be “reversed” by nesting the ISBLANK function inside the NOT function: The formula above can be re-written to use ISBLANK as follows:

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.