Tuesday, July 20, 2010

Word Count in a Cell or a Range of Cells

Use the below formula to count the number of words in a particular cell:

=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+COUNTA(A1)

This will count the no. of words in cell A1.

Use the below formula to count the number of words in a range of cells:

=LEN(TRIM(A1&A2&A3&A4&A5))-LEN(SUBSTITUTE(A1&A2&A3&A4&A5," ",""))+COUNTA(A1:A5)

This will count the no. of words in cells A1 to A5.

No comments:

Post a Comment