Count the Number of Words in a Text String

Count the Number of Words in a Text String

The following formula counts the number of words in A2...

=IF(LEN(TRIM(A2))>0,LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))+1,0)

Based on the sample data, the formula returns 8.

Sample Workbook: Download