How to Use COUNTIF to Count Non-Blank Cells in Google Sheets

Blank cells can create confusion when you’re summarizing data, tracking inputs, or building reports in Google Sheets. The COUNTIF function offers a simple way to count only the cells that are filled, excluding empty cells from your calculations.

In this article, you’ll learn multiple ways to use COUNTIF to count non-blank cells. Whether you’re working with single columns, various ranges, or want to ignore cells that contain only spaces, we’ll show you exactly how to structure your formulas with practical examples.

Key Takeaways

Steps to count non-blank cells in a single column using the COUNTIF function:

➤ Use the dataset in cells A1:C11, with columns for Name, Email, and Phone Number.
➤ To count how many Email cells are not blank, enter the formula in cell E2:
=COUNTIF(B2:B11, “<>”)
B2:B11 specifies the Email column as the target range.
“<>” is the condition used to detect non-empty cells.
➤ The formula returns the number of cells that contain data.
➤ Press Enter to display the count of filled email addresses in the dataset.

overview image

Download Practice Workbook
1

Basic COUNTIF to Count Non-Blank Cells in a Single Column

The most straightforward method to count non-blank cells in Google Sheets is by using the COUNTIF function. It allows you to quickly check how many entries in a specific column are filled, making it useful for tasks like validating form completion or checking missing information. This method focuses on one column at a time, helping you isolate fields like names, emails, or phone numbers.

This is the dataset we will be using to demonstrate the methods:

Basic COUNTIF to Count Non-Blank Cells in a Single Column

Steps:

➤ Use the dataset in cells A1:C11, where columns represent Name, Email, and Phone Number.
➤ To count how many entries in the Email column are not blank, enter this formula in cell E2:

=COUNTIF(B2:B11, “<>”)

Basic COUNTIF to Count Non-Blank Cells in a Single Column

Explanation
B2:B11: This defines the range you want to count, in this case, the Email column.
"<>": This is the COUNTIF condition that means "not blank." It checks for any cell that contains data.
➧ The formula will return the number of non-empty cells in the specified range.

➤ When you press Enter, Google Sheets will show the count of filled email addresses in the dataset.

Basic COUNTIF to Count Non-Blank Cells in a Single Column

➤ This method is ideal for quickly validating how many fields are complete in a single column.


2

Count Non-Blank Cells in Multiple Non-Adjacent Ranges Using COUNTIF

When your dataset has related information spread across multiple columns and you want to count how many non-blank entries exist across them, you can use multiple COUNTIF functions combined with the plus (+) sign. This approach is helpful for evaluating overall data completeness across fields like Email and Phone Number together, even when they are in non-adjacent columns.

Steps:

➤ Use the dataset in cells A1:C11.
➤ Suppose you want to count how many cells in both the Email column (B) and the Phone Number column (C) are not blank.
➤ In cell E2, enter the following formula:

=COUNTIF(B2:B11, “<>”) + COUNTIF(C2:C11, “<>”)

Count Non-Blank Cells in Multiple Non-Adjacent Ranges Using COUNTIF

Explanation
COUNTIF(B2:B11, "<>"): Counts the number of non-blank cells in the Email column.
COUNTIF(C2:C11, "<>"): Counts the number of non-blank cells in the Phone Number column.
+: Adds the results of both counts to get the total number of filled cells across both columns.

➤ Press Enter to get the total number of non-empty cells across both ranges.

Count Non-Blank Cells in Multiple Non-Adjacent Ranges Using COUNTIF

➤ This method is ideal when you want a quick combined count of filled data across multiple non-adjacent columns.


3

Calculate Number of Non-Blank Cells That Do Not Equal a Specific Value

When analyzing data, you may want to count only the non-blank entries while excluding specific unwanted values such as “N/A” or “Unknown.” This is useful for focusing on valid responses or actual data points while filtering out placeholders or default text. The COUNTIF function can be used in combination to achieve this.

This is the updated dataset for this method.

Calculate Number of Non-Blank Cells That Do Not Equal a Specific Value

Steps:

➤ Suppose you want to count the number of people who have provided a phone number in column C but exclude those who entered “N/A”.
➤ In a blank cell, enter this formula:

=COUNTIF(C2:C11, “<>”) – COUNTIF(C2:C11, “N/A”)

Calculate Number of Non-Blank Cells That Do Not Equal a Specific Value

Explanation
C2:C11: Refers to the range of phone numbers being evaluated.
COUNTIF(C2:C11, "<>"): Counts all non-blank cells in the range.
COUNTIF(C2:C11, "N/A"): Counts how many of those entries are exactly "N/A".
➧ Subtracting the second result from the first filters out unwanted placeholder values.

➤ Press Enter.

Calculate Number of Non-Blank Cells That Do Not Equal a Specific Value

➤ This method is effective for cleaning and filtering your dataset by removing noise, ensuring you only count meaningful, non-blank data entries.


4

Combining Trim in FILTER & COUNTIF Functions

When working with data imported from forms or manually entered by users, cells may contain hidden spaces that make them look blank but still register as non-empty. Using just COUNTIF will incorrectly count these cells. To ensure you’re counting only truly non-blank cells, you can combine ARRAYFORMULA with TRIM and COUNTIF. This method cleans the values before counting them, giving accurate results.

This is the dataset we will be using:

Combining Trim in FILTER & COUNTIF to Count Non-Blank Cells Ignoring Whitespaces

Steps:

➤ Start with the dataset in cells A1:C11, which includes Name, Email, and Phone Number columns. Some cells may look empty but contain spaces.
➤ In a new column (e.g., E2), enter the following formula to trim and return a total count of cleaned values from column B (Email):

=COUNTIF(FILTER(TRIM(B2:B11), TRIM(B2:B11)<>””), “<>”)

Combining Trim in FILTER & COUNTIF to Count Non-Blank Cells Ignoring Whitespaces

Explanation
TRIM(B2:B11): Removes any leading and trailing spaces from each cell in the range.
FILTER(..., TRIM(B2:B11)<>""): Filters out any cell that becomes empty after trimming.
COUNTIF(..., "<>"): Counts only the entries that still have content after trimming and filtering.

➤ Press Enter. The result will show the count of truly non-blank email addresses (excluding invisible blanks or cells with just spaces).

Combining Trim in FILTER & COUNTIF to Count Non-Blank Cells Ignoring Whitespaces

➤ This method is best when you want precise control over what counts as “not blank,” especially in datasets that may include stray formatting or accidental spacebars.


Frequently Asked Questions

Can COUNTIF count multiple non-blank columns at once?

No, the COUNTIF function only accepts one range at a time. If you want to count non-blank cells across multiple columns, you’ll need to use multiple COUNTIF formulas and add them together.

What does “<>” mean in COUNTIF?

In COUNTIF, “<>” is a logical operator that means “not equal to blank.” It checks if a cell contains any value at all and excludes truly empty cells from the count.

Does COUNTIF ignore cells with only spaces?

By default, no. COUNTIF treats cells containing only spaces as non-blank because technically they hold a character. Use the FILTER function with TRIM to eliminate such space-only cells before counting.

Can COUNTIF be used with conditions besides checking for blanks?

Absolutely. COUNTIF supports various conditions, such as matching specific text, numbers, dates, or operators like “>100” or “=Complete”, making it versatile for filtering data in many contexts.


Wrapping Up

Counting non-blank cells in Google Sheets is simple and effective with the COUNTIF function. Whether you’re checking filled entries in a form, validating user responses, or cleaning your data, this function gives you quick insights without the need for complex formulas. For more complex checks, such as ignoring spaces or applying multiple conditions, you can expand on COUNTIF using the TRIM or FILTER functions.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply

Excel Insider
Logo