Function Problems

Count Nonblank Excel Cells with COUNTIF and COUNTIFS

Jason MillerJason Miller Nov 22, 2026 868 views

Question details

Count nonblank cells in an Excel range and apply multiple conditions when needed.

How to Count Nonblank Excel Cells with COUNTIF and COUNTIFS
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to count populated cells without including empty values and learn when to use COUNTIFS.
Observed behavior
The desired result is a count of nonblank cells, optionally limited by additional criteria.
Before you start

Identify the range to count and check whether it contains formulas that return an empty string or cells containing only spaces. These can affect how different counting functions treat the cells.

Solution 1Recommended

Use COUNTIF to Count Nonblank Cells

Use COUNTIF when you need a single count of cells that are not blank.

1
Select a result cell

In Excel, click an empty cell where you want the count to appear.

2
Enter the formula

Type =COUNTIF(A1:A10,"<>") and press Enter. Replace A1:A10 with the range you want to count.

3
Check the result

Compare the result with the cells in the selected range. Cells containing only spaces are treated as nonblank.

Use COUNTIF to Count Nonblank Cells
COUNTIF versus COUNTA: COUNTA counts cells containing formulas, even when a formula returns an empty string. COUNTIF with the "<>" criterion generally excludes those empty-string results, so the counts can differ.
Count nonblank cells

Count Nonblank Cells in WPS Spreadsheet

Use COUNTIF in WPS Spreadsheet to count nonblank cells, or add criteria with COUNTIFS when you need to filter the count.

  1. 1. Open your spreadsheet: Open WPS Spreadsheet and select Open to load your workbook.
  2. 2. Choose a result cell: Click an empty cell where you want the count.
  3. 3. Enter COUNTIF: Type =COUNTIF(A1:A10,"<>") in the cell and press Enter. Change the range to match your data.
  4. 4. Add conditions if needed: For multiple criteria, enter a formula such as =COUNTIFS(A1:A10,"<>",B1:B10,"Complete") in the result cell.
Count nonblank cells with familiar COUNTIF formulasApply multiple conditions with COUNTIFSOpen and edit Microsoft Excel XLS and XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Do I need to combine COUNTIF and COUNTA to count nonblank cells?

No. Enter =COUNTIF(A1:A10,"<>") in a result cell to count nonblank cells in that range.

Why does COUNTA return a different count from COUNTIF?

COUNTA counts cells containing formulas even if those formulas return an empty string. COUNTIF with the "<>" criterion generally excludes those results.

How do I count nonblank cells only when another column meets a condition?

Use COUNTIFS with both criteria. For example, =COUNTIFS(A1:A10,"<>",B1:B10,"Complete") counts rows with a nonblank value in column A and Complete in column B.

Are cells containing only spaces counted as nonblank?

Yes. A space is a character, so a cell containing only spaces is treated as nonblank by COUNTIF with the "<>" criterion.