SheetsXSheetsX
Google Sheets COUNTIF guide

Count Non-Empty Cells in Google Sheets

Use a native formula when you know the range, or ask the SheetsX Agent to write and verify it for you. The demo counts three populated cells and preserves the rest of the sheet.

Reviewed by the SheetsX team

General count
=COUNTA(A2:A7)

Counts text, numbers, dates, TRUE/FALSE values, and errors that are present in the range.

COUNTIF not blank
=COUNTIF(A2:A7,"<>")

Uses the not-equal-to-empty criterion and fits workflows already based on COUNTIF.

Verified demo result
3

SheetsX placed the formula in B2 and confirmed the three populated cells in the source range.

Quick answer

How do you count cells that are not blank in Google Sheets?

Use =COUNTA(A2:A7) to count every non-empty value in a range. Use =COUNTIF(A2:A7,"<>") when you specifically want a COUNTIF not-blank criterion. Put the formula in an empty result cell, press Enter, and verify the number against a small sample before copying it into a production workflow.

Recorded demo

Watch SheetsX count filled cells and verify the result

The Agent inspects the source range, writes one targeted COUNTIF formula, checks the calculated value, and confirms that unrelated cells were not changed.

Fictitious demo data · no private information

The recording shows a result of 3 in B2. The entire SheetsX prompt, progress log, and final verification are in English.

Prompt used in the demo

Count the non-empty cells in A2:A7 and put the result in B2. Use COUNTIF with the non-empty criterion, keep the source range unchanged, and verify the formula and result. Respond in English only.

Step by step

How to count non-empty cells in Google Sheets

Choose the formula based on what should count as populated, then test it against a range whose contents you can inspect quickly.

  1. 1

    Select the source range

    Identify the exact cells to inspect, such as A2:A7. Exclude the header unless it should be part of the count.

  2. 2

    Enter COUNTA or COUNTIF

    Use COUNTA for a broad populated-cell count, or COUNTIF with the not-blank criterion when the surrounding workflow already relies on conditional counting.

  3. 3

    Verify the result

    Compare the calculated number with the visible sample. Check cells containing formulas, spaces, or errors before reusing the formula on a larger range.

Examples and edge cases

COUNTA and COUNTIF formulas for non-empty cells

These patterns cover a single column, multiple columns, and rows that must meet an additional condition.

Use caseFormula or settingWhat it does
Count all populated cells=COUNTA(A2:A100)Counts values present in A2:A100, including text, numbers, dates, errors, and formulas that return a value.
COUNTIF not blank=COUNTIF(A2:A100,"<>")Counts cells that satisfy the not-blank criterion. Use this when you want a COUNTIF-style formula.
Count populated cells in two columns=COUNTA(A2:B100)Counts each populated cell across both columns; it does not count unique rows.
Count completed rows=COUNTIFS(A2:A100,"<>",B2:B100,"Complete")Counts rows where column A is populated and the matching status in column B is Complete.
SheetsX workflow

Ask SheetsX for one formula and one verification

A precise prompt should name the input range, destination cell, formula family, and cells that must remain unchanged. The Agent can then report the actual formula and calculated result.

Install SheetsX
  • Open a new Agent chat for a clean task context.
  • Name the source range and result cell explicitly.
  • Say whether you want COUNTA, COUNTIF, or an additional condition.
  • Tell the Agent to preserve source data and formatting.
  • Review both the inserted formula and the visible result.
FAQ

Non-empty cell counting questions

What formula counts non-empty cells in Google Sheets?+

COUNTA is the simplest general formula: =COUNTA(A2:A100). A COUNTIF alternative is =COUNTIF(A2:A100,"<>").

Does COUNTA count text and numbers?+

Yes. COUNTA counts non-empty text, numbers, dates, Boolean values, errors, and other values present in the range.

How do I count non-empty rows instead of individual cells?+

Choose one required column as the row key and count its populated cells, or use COUNTIFS when a row must also meet another condition. Counting a multi-column range with COUNTA counts cells, not rows.

Why is my non-empty count higher than expected?+

Inspect cells that look blank but contain formulas, spaces, apostrophes, errors, or other invisible content. Test the formula on a small sample and clean the source data if necessary.

Can SheetsX write the formula without changing my source data?+

Yes. Name an empty destination cell and explicitly tell the Agent to keep the source range and formatting unchanged. Review the final verification before continuing.