In other words, we have a list of word counts, with one word count per cell.

SUMPRODUCT then sums this list and returns a total for all cells in the range.

Note that the formula inside SUMPRODUCT will return 1 even if a cell is empty.

Excel SUMPRODUCT function

The double hyphen coerces the result to 1’s and 0’s.

We use TRIM again to ensure we don’t count cells that have one or more spaces.

SUMPRODUCT Function

The Excel SUMPRODUCT function multipliesrangesorarraystogether and returns the sum of products.

Excel LEN function

LEN will also count characters in numbers, but number formatting is not included.

SUBSTITUTE Function

The Excel SUBSTITUTE function replaces text in a given string by matching.

Excel SUBSTITUTE function

Excel TRIM function