Formula Errors

How to Count Formula Results Without Empty Strings in Excel

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 869 views

Question details

The user needs to count the number of cells in a range that display visible data, specifically excluding cells where existing formulas return an empty string.

How to Count Formula Results Without Empty Strings in Excel
Product
Excel
Device & OS
not provided
Scenario
Counting specific data entries in a spreadsheet range that is populated by formulas, which sometimes evaluate to empty strings.
Observed behavior
The standard COUNTA function incorrectly counts cells containing formulas as non-blank, even when those formulas output an empty text string ("").
Before you start

Verify your target cell range and check if any hidden spaces or error values are present in the dataset, as these can affect counting functions.

Solution 1Recommended

Use the ROWS and COUNTBLANK Combination

This is the most reliable method to count visible results, constants, and errors while ignoring empty strings generated by formulas.

The COUNTBLANK function specifically counts empty cells and cells containing formulas that return an empty text string (""). By subtracting this count from the total number of rows in your range, you get the exact number of visually non-blank cells.

1
Select an output cell

Click on an empty cell where you want the final count result to be displayed.

2
Enter the formula

Type the formula `=ROWS(A1:A100)-COUNTBLANK(A1:A100)` into the formula bar, replacing `A1:A100` with your actual data range.

3
Apply the calculation

Press the Enter key on your keyboard to execute the formula and view the accurate count of non-empty cells.

Use the ROWS and COUNTBLANK Combination
Error Values in Range: Be aware that if your range contains cells with #N/A or #DIV/0! errors, the total formula may return an error depending on your spreadsheet version. You may need to resolve range errors first.
Data Calculation

Count Data Accurately with WPS Spreadsheet

WPS Spreadsheet provides robust formula support, allowing you to easily handle complex counting tasks and ignore empty formula strings. It seamlessly supports advanced logic like COUNTBLANK, ROWS, and SUMPRODUCT.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the data you need to count.
  2. 2. Select the result cell: Click on any empty cell where the final count should appear.
  3. 3. Input the calculation: Type `=ROWS(A1:A100)-COUNTBLANK(A1:A100)` in the formula bar, updating the range as needed.
  4. 4. Press Enter: Hit Enter to immediately view your accurate data count, completely free of empty string interference.
100% compatible with Microsoft Excel formulas and file formats.Lightweight software with fast calculation speeds for large datasets.Familiar user interface makes it easy to write, edit, and audit formulas.Free built-in features for advanced data tracking and analysis.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the COUNTA function count empty cells with formulas?

COUNTA is designed to count any cell that is not completely empty. Because a formula itself is considered content, COUNTA includes it in the total calculation even if the formula's visual output evaluates to an empty string ("").

Can I use COUNTIFS to ignore empty strings?

Yes, you can use `=COUNTIFS(A1:A100, "?*")` to count cells containing text characters, which effectively ignores empty strings. However, note that this specific wildcard method will only count text and will ignore cells containing pure numbers.

Does COUNTBLANK count cells that contain space characters?

No, COUNTBLANK only counts cells that are entirely empty or contain a formula returning a completely empty string (""). If a cell contains a space character (" "), it is considered non-blank and will not be counted by COUNTBLANK.