+ Reply to Thread
Results 1 to 9 of 9

Counting Words?

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Counting Words?

    Hi There,
    Does anyone knows the formula that is capable of counting words?
    The trick is that words are separated by coma (see example below)

    Example:

    Box,Cable,Cup
    Plate,Cup,Cable
    Key,Box
    Ring,Box,Cable
    Pen,Box,Key

    And so on...

    I need to find the way of calculating each word so would appreciate if someone knows how to do it.

    Best Regards
    Dan

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Counting Words?

    Try this:

    =LEN(A1&",")-LEN(SUBSTITUTE(A1,",",""))

    assuming your string is in A1.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Counting Words?

    Thank You but this formula will only calculate number of words separated with comma right?
    I need to count each word separately...

    Dan

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Counting Words?

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


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Counting Words?

    Quote Originally Posted by ciapul12 View Post
    ... to count each word separately...
    I'm not sure what you mean by this. Do you mean count the number of letters that make up each word?

    Pete

  6. #6
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Counting Words?

    Thank You both for formulas.
    I probably haven't explained exactly what my aim is, my apologies for that.

    I have attached a spreadsheet that shows exactly what I'm after.
    Data tab contains product names and column with fail reasons separated by comma.
    Another tab called List, contains list of all Fail reasons and that's where I would like to have a calculation so that I can compare both lists and count if mach is found (problem is where words are separated by comma and need to be treated as separate fail reasons)

    Dan
    Attached Files Attached Files

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Counting Words?

    I think you are looking for something like this in C2 of the List sheet:

    =COUNTIFS(Data!B:B,"*"&B2&"*",Data!A:A,A2)

    The asterisks around the B2 term are wildcard characters, which means any characters on either side (essentially "contains").

    However, I see that you have "Rot" and "Rots" (and also "Hard Rot" and "Collapsing rot") as FailureReasons, and so the value for "Rot" would also include those other reasons as it is a substring, so it might not be completely accurate.

    Hope this helps.

    Pete

  8. #8
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Counting Words?

    Hi Pete,
    WOW this is amazing and it actually works!
    I'd like to include more fields into my data so that I can use slicers on pivot table but the formula you provided me with doesn't work for this purpose..
    Would you be able to tell me how this can be achieved?

    I need to be able to filter data once summarized by Fail type.

    Thank you kindly for your help.

    Dan
    Attached Files Attached Files

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Counting Words?

    Glad to hear that it worked for you.

    Slicers were not available in XL2007 (which I use), so I can't help you with them. Hopefully someone else will chip in.

    Pete

+ 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] counting occurrence of specific words in another group of words
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2021, 07:33 PM
  2. Counting occurrences not values.. Counting blocks of words in columns
    By Flydd in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-01-2016, 06:42 PM
  3. Counting words
    By burnsie in forum Excel General
    Replies: 1
    Last Post: 10-15-2015, 11:37 AM
  4. [SOLVED] counting words
    By makinmomb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-01-2015, 07:47 AM
  5. counting words
    By Duckie in forum Excel General
    Replies: 2
    Last Post: 01-18-2010, 07:28 PM
  6. Counting words............
    By Smokey_Vol in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-21-2005, 11:35 AM
  7. Counting words
    By johanl in forum Excel General
    Replies: 1
    Last Post: 07-30-2005, 06:05 AM

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