Tuesday, June 21, 2011

yogi_Count Number Of CharactersWithoutSpaces, Words, And Sentences In A Text String

Yogi Anand, D.Eng, P.E.                                         Google Spreadsheet                            www.energyefficientbuild.com
kattussz said:
Count the number of words and sentences
How do I count the number of:
1. characters without spaces;
2. words;
3. sentences
in a cell containing a string?
------------------------------------------------------------------

5 comments:

  1. This post is very helpful! Thanks a lot!
    Using the ArrayFormula function, is not necessary to copy the formula from cell to cell in the entire column.

    ReplyDelete
  2. Hi kattusssz:

    Thanks for your comment. If the ArrayFormula is used then there is no need to copy the formula down from cell to cell.
    In any event, I have created Sheet1 using the non-array formulas, and Sheet2 with formulas using the ArrayFormula function.

    Cheers!
    Yogi

    ReplyDelete
  3. When You calculate the number of sentences (E2), you are looking for sentences ending with ".". How do I modify the formula to treat cases, when the cell to count the number of sentences contain sentences ending with "?", "!". Maybe, the integration of OR logical function can be useful?

    ReplyDelete
  4. Hi Katttusssz:

    Please have a look at Sheets 2 and 3 that I have added to address handling sentences ending with . or ? or !

    Cheers!
    Yogi

    ReplyDelete
  5. I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? word counter

    ReplyDelete