Please consider supporting this website by buying me a coffee.
Thank you for your consideration!

Updated | November 16, 2024

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 B3...

=IF(LEN(TRIM(B3))>0,COUNTA(TEXTSPLIT(TRIM(B3)," ")),0)

For earlier versions of Excel...

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

Based on the sample data, the formula returns 5.

Sample Workbook: Download