How to Count Formula Results Without Empty Strings in Excel
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.

- 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 ("").
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.
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.
Click on an empty cell where you want the final count result to be displayed.
Type the formula `=ROWS(A1:A100)-COUNTBLANK(A1:A100)` into the formula bar, replacing `A1:A100` with your actual data range.
Press the Enter key on your keyboard to execute the formula and view the accurate count of non-empty cells.

Use the SUMPRODUCT Function
An alternative mathematical approach that evaluates which cells do not strictly equal an empty string.
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. Open your dataset: Launch WPS Spreadsheet and open the document containing the data you need to count.
- 2. Select the result cell: Click on any empty cell where the final count should appear.
- 3. Input the calculation: Type `=ROWS(A1:A100)-COUNTBLANK(A1:A100)` in the formula bar, updating the range as needed.
- 4. Press Enter: Hit Enter to immediately view your accurate data count, completely free of empty string interference.

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.




