+ Reply to Thread
Results 1 to 7 of 7

Count number of words refer to the list in a cell

  1. #1
    Registered User
    Join Date
    01-30-2018
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    2

    Count number of words refer to the list in a cell

    Hi all, anyone can solve this question?

    Suppose I have two lists, namely WordList1 and WordList2, each containing some keywords I defined. For example, abc1, abc2, ... and abc5 belongs to WordList1

    I want to write an excel function to count how many occurrence of keywords from the same group appears.

    For example, "abc1 abc1 iiiiijjjkkkk" countains two "abc1", therefore WordCount1 (refer to WordList1) is 2.

    f.JPG

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Count number of words refer to the list in a cell

    Try:

    =SUMPRODUCT(COUNTIF(A9,"*"&B$2:B$6&"*"))

  3. #3
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Count number of words refer to the list in a cell

    Try

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


    Copy across!
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count number of words refer to the list in a cell

    Quote Originally Posted by shukla.ankur281190 View Post
    Try

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


    Copy across!
    Ankur, you are complicating the formula, Phuocam is good one, if you see the example of op "abc1abc2eee4eee4", here there is no space between words even though he wants the counts. So there is no need of substitute
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Count number of words refer to the list in a cell

    Siva, Sorry but I still don't believe what OP asked for, Phuocam formula does. I have given solution as per his expected result I am agree that substitute made this formula scary but trust me I am doing what I have learned you and others as well

    Have a great day

    Regards,
    Ankur

  6. #6
    Registered User
    Join Date
    01-30-2018
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    2

    Re: Count number of words refer to the list in a cell

    Thank you but the result is not the same as what I want.

    For example, "abc1 abc1 iiiiijjjkkkk" countains two "abc1", therefore WordCount1 (refer to WordList1) is 2, not 1.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Count number of words refer to the list in a cell

    try

    in B9

    =SUMPRODUCT((LEN($A9)-LEN(SUBSTITUTE($A9,B$2:B$6,"")))/LEN(B$2:B$6))

    copy across to C and down
    Attached Files Attached Files
    Last edited by JohnTopley; 01-30-2018 at 06:57 AM.

+ 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] Count words in a cell & output number of occurences of each word in adjecent cell.
    By kprasad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2017, 07:28 AM
  2. Count number of different words in a list
    By pedro90 in forum Excel General
    Replies: 17
    Last Post: 01-15-2015, 09:50 AM
  3. Replies: 5
    Last Post: 09-02-2014, 03:49 PM
  4. How to count the number of words in a cell with line breaks?
    By felipemejiag in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-06-2014, 11:42 AM
  5. [SOLVED] Count the number of words in a cell separated with with two different signs
    By Lija in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-30-2013, 06:11 AM
  6. How do I count the number of words in a cell?
    By Phil in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2006, 02:20 PM
  7. Using 'If' refer to specific words in a cell containing text
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-10-2005, 09:02 AM

Tags for this Thread

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