Applies ToExcel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2024 Excel 2024 for Mac Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2016

Use the COUNTBLANK function, one of the Statistical functions, to count the number of empty cells in a range of cells.

Syntax

COUNTBLANK(range)

The COUNTBLANK function syntax has the following arguments:

  • Range    Required. The range from which you want to count the blank cells.

Remark

Cells with formulas that return "" (empty text) are also counted. Cells with zero values are not counted.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet.

Data

Data

6

27

4

34

Formula

Description

Result

=COUNTBLANK(A2:B4)

Counts empty cells in the range above.

2

Note: Copying from some browsers may add an apostrophe to the beginning of the formula when it's pasted in Excel. If the formula does not show a result, select that cell, press F2, delete the apostrophe, and then press Enter.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in Communities.

See Also

Overview of formulas in Excel

How to avoid broken formulas

Find and correct errors in formulas

Excel keyboard shortcuts and function keys

Excel functions (alphabetical)

Excel functions (by category)

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.