Since C7 has no value in the screen above, the formula shows no result. In the screen below, C7 contains a number and the sum is displayed:

In the example shown, we are using the IF function together with the COUNT function. The criteria is an expression based on the COUNT function, which only counts numeric values: As long as the range contains three numbers (i.e. all 3 cells are not blank) the result is TRUE and IF will run the SUM function. If not, result is FALSE and IF returns an empty string (""). Since C7 has no value in the screen above, the formula shows no result. There are many ways to check for blank cells, and several options are explained below.

With COUNTBLANK

The COUNTBLANK function counts empty cells in a range, so we can write a slightly more compact formula like this: If COUNTBLANK returns any number except zero, the IF function will evaluate as TRUE, and return nothing (""). If COUNTBLANK returns zero, IF evaluates as FALSE and returns the sum.

With ISBLANK

In the example shown, input cells are all in the same contiguous range. In cases where cells are not together, you can a formula like this: This example takes a literal approach with the ISBLANK function. Because we want to check all three cells at the same time, we need to use ISBLANK three times inside the OR function. This is the logical test inside IF: When OR returns TRUE (at least one cell is empty), IF returns an empty string (""). When OR returns FALSE (no cells are blank), IF runs the SUM function and returns the result:

With logical operators

The ISBLANK function can be replaced with standard logical operators like this: Alternately, we can combine the not equal to operator (<>) with AND function like this: Notice the SUM function has been moved to the TRUE result. It will run only if C5 and C6 and C5 are not empty.

With COUNTA

Finally, you can use the COUNTA function to check for numeric or text input: As long as the range C5:C5 contains three values (numbers or text), the result will be TRUE and the SUM function will run. This doesn’t really make sense for the example shown (which requires numeric input) but it can be used in other situations.

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.