Here's an Excel tip that provides a solution for a problem I've been wanting to solve for months - how to count the number of words in a cell in an Excel spreadsheet.

What I have is a spreadsheet of words that I use for analyzing keywords for SEO purposes. In the first column is a list of phrases. I've created a new column next to it where I'd like to have Excel display the number of words in each phrase.

I'm not an Excel guru, but I at least knew that finding the number of words would involve calculating the number of spaces in each phrase. Still, I don't know enough about Excel functions but a Google search for 'how to count the number of words in a cell' led me to this page with an Excel formula to calculate the number of words in a cell.

I learned that all I had to do was implement  the following formula in my spreadsheet:

=LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ",""))+1

As my data doesn't start at cell A1, I just modified the formula by replacing A1 with A2.

Next, all that was needed was to drag the corner of cell B2 down so that Column B would be filled with the correct word count data calculated by the formula.

This word count  formula for Excel  came in handy for me as I can now routinely count the  number of words in text and sort the resulting cells according to word count.

Microsoft's support web site also offers some Formulas to count the occurrences of text, characters, or words in Excel for Mac, but I haven't tried them. I assume, too, that these formulas would would just as well on the Windows version of Excel.