Explanation

The goal is to verify the input of all required values before calculating a result.

In the worksheet shown, the SUM function is used as an example only.

The logic can be adjusted in many ways to suit the situation.

Excel formula: If cell is blank

Below are several examples of how you’re able to approach this problem.

The best solution depends on the requirements of the project and your personal preference.

Otherwise, display nothing.

Excel formula: If cell contains

In Excel, an empty string will look like an empty cell.

Since C7 has no value in the original worksheet, the formula displays no result.

There are many ways to check for blank cells, and several other options are explained below.

Excel formula: Return blank if

If COUNTBLANK returns zero, IF will evaluate zero as FALSE and return the result from the SUM function.

In other words, the OR function will return TRUE if any of the ISBLANK functions return TRUE.

In the current version of Excel, it will work fine as-is.

Excel formula: If cell is not blank

In this formula, we pass a range into ISBLANK and ISBLANK returns anarraythat contains 3 results.

If all values in the array are FALSE (i.e.

numbers or text).

Excel formula: All cells in range are blank

More than one condition can be tested by nesting IF functions.

The IF…

COUNT Function

The Excel COUNT function returns a count of values that are numbers.

Numbers include negative numbers, percentages, dates, times, fractions, and formulas that return numbers.

Excel IF function

For example, if A1 contains “apple”, ISBLANK(A1) returns FALSE.

COUNTBLANK Function

The Excel COUNTBLANK function returns a count of empty cells in arange.

Cells that contain text, numbers, errors, spaces, etc.

Excel COUNT function

Formulas that return empty strings ("")arecounted as blank.

AND returns TRUEonly if all the conditions are met.

If any conditions are not met, the AND function returns FALSE.

Excel ISBLANK function

OR returns TRUEif any condition is TRUE.

If all conditions are FALSE, the OR function returns FALSE.

Excel COUNTBLANK function

Excel AND function

Excel OR function

Article image