There are several ways to go about this task, depending on your needs.
The article below explains different approaches.
COUNTA function
While theCOUNT functiononly counts numbers, theCOUNTA functioncounts both numbers and text.
This means you could use COUNTA as a simple way to count cells that are not blank.
COUNTA is fully automatic, so there is nothing to configure.
The secondrange/criteriapair selects cells that are not empty.
The result from COUNTIFS is 4, since there are 4 cells in Group A that are not empty.
it’s possible for you to swap the order of therange/criteriapairs with the same result.
See also:50 examples of formula criteria.
But this formula will ignore empty strings ("") returned by formulas.
you’re free to easily adjust the logic used in SUMPRODUCT with other functions as needed.
you could read more about this topic here:Why SUMPRODUCT?
COUNTA does not count empty cells.
COUNTBLANK Function
The Excel COUNTBLANK function returns a count of empty cells in arange.
Cells that contain text, numbers, errors, spaces, etc.
Formulas that return empty strings ("")arecounted as blank.