+ Reply to Thread
Results 1 to 7 of 7

Count number of words refer to the list in a cell

Hybrid View

  1. #1
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,998

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

    Try

    B9
    Formula: copy to clipboard
    =SUMPRODUCT(COUNTIF(B$2:B$6,INDEX(TRIM(MID(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A9,"1","1 "),"2","2 "),"3","3 "),"4","4 "),"5","5 "))," ",REPT(" ",99)),(ROW(INDIRECT("1:"&99-LEN(SUBSTITUTE($A9," ",""))+1))-1)*99+1,99)),)))


    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)

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

    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
    =SUMPRODUCT(COUNTIF(B$2:B$6,INDEX(TRIM(MID(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A9,"1","1 "),"2","2 "),"3","3 "),"4","4 "),"5","5 "))," ",REPT(" ",99)),(ROW(INDIRECT("1:"&99-LEN(SUBSTITUTE($A9," ",""))+1))-1)*99+1,99)),)))


    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.

+ 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. [SOLVED] 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. [SOLVED] 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