+ Reply to Thread
Results 1 to 11 of 11

Word Count

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Word Count

    Hello,

    I want to count # of words used in a query. See attachment.

    Desired result is in Column D, which should count sample set of words that are in column c which is compared against column a, else put -


    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97 for Mac MS 365
    Posts
    8,700

    Re: Word Count

    either of these will return a 1 or 0 but that is all, if you have for example, wolf twice in the cell both will still return 1.
    =IF(ISNUMBER(SEARCH(C2,$A$2)),1,0)
    =COUNT(SEARCH(C2,$A$2))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: Word Count

    Hi Sam,

    Yes your formula works but my example was bad. i have re-uploaded. Cell A2 is the default. desired result in cell d5 should be 2, as i have used cat two times in cell a2. I tried your formula and it returned only 1.

    appreciate any help in advance
    Attached Files Attached Files

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Word Count

    If you want to get the total of the lookup words try this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: Word Count

    Hi All, I'm looking for total count of words in column c by row, not the aggregate, as you have referneced.

    Below is desired result:

    Word
    wolf 1
    dog 1
    dogs 1
    cat 2
    cats 1
    jumps 0

  6. #6
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Word Count

    Hi,

    Will there be "Line Feeds" with No Space in your Actual data just like your sample in Post #3?

  7. #7
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: Word Count

    Yes there can be line breaks within data for example:

    1-10
    the wolf jumped over the cat dog and dogs
    cat
    cats

    lions

  8. #8
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Word Count

    Then this will give you the separate word counts as you require.

    For your uploaded sample, in D2 copied down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached.
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Word Count

    another way
    =SUMPRODUCT(COUNTIF(C2,TRIM(MID(SUBSTITUTE(SUBSTITUTE(A$2,CHAR(10)," ")," ",REPT(" ",LEN(A$2))),(ROW(Z1:Z99)-1)*LEN(A$2)+1,LEN(A$2)))))

  10. #10
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Word Count

    Another way and hope it works

    =SUMPRODUCT((LEN($A$2)-LEN(SUBSTITUTE($A$2,C2,"")))/LEN(C2))
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    79

    Re: Word Count

    @azumi,

    Your formula count - say cat- but cats too, as cat.
    dogs as dog.....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] vlookup word in a column and count the # of rows between each use of the word
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-03-2017, 02:23 PM
  2. Replies: 5
    Last Post: 08-17-2015, 10:55 AM
  3. [SOLVED] (Challenge) Sum Order From Count "Center" Word To Start Word & "Center" Word To End Word
    By sanju2323 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-31-2015, 12:58 AM
  4. count same word
    By Duckie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2009, 11:46 PM
  5. Word count
    By just66horns in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2008, 07:52 PM
  6. How to open a Word.doc using VBA and count the words in the word.doc?
    By eijoah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2007, 12:58 AM
  7. word count
    By damian edwards in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2007, 06:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1