+ Reply to Thread
Results 1 to 12 of 12

Counting cells with numbers in the column that contains specific words

  1. #1
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Counting cells with numbers in the column that contains specific words

    Hi all,

    I’m trying to build a function, but I haven’t been able to successfully navigate some of the eccentricities of Excel formula-building.

    Right now I am working on counting all of the cells that contain numbers (so likely just a =COUNT function), but will be eventually getting other descriptive stats as well. My problem is that I would like to create a formula that will perform the counting/mean calculation, etc., but only on a specific column that has the header cell that contains several specific words. Rather than having to type in the target words for each column, I would like to have the target words in the function be imported from multiple designated cells.

    For example,

    I want to find how many numbered cells are found in column E headed as "dog brown,” but I also have columns headed as "cat brown" "dog black" etc. (which I will be using the formula on later)
    to paint a small picture, in my descriptives table, "dog" is in B31 and “brown” is in C30, then “cat” in B32 and “black” in D30.


    UPDATE: people are smart and helpful and I have no more worries in this world
    Solved by the lovely internet people.xlsx
    Attached Files Attached Files
    Last edited by dnov; 05-09-2014 at 06:08 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells with numbers in the column that contains specific words

    Hi and welcome to the forum.

    Could we have a workbook with some examples and your desired results?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Counting cells with numbers in the column that contains specific words

    Maybe with SUMPRODUCT?
    Attached Files Attached Files
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells with numbers in the column that contains specific words

    Promoting your taste in music, daffodil?

  5. #5
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Counting cells with numbers in the column that contains specific words

    Definitely can do, thanks a lot!
    Attached Files Attached Files

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells with numbers in the column that contains specific words

    Nice workbook name!

    I disagree with your totals as there seem to be 14 participants, not 13, for Task1.

    In G22 and copy down:

    =COUNT(INDEX($B$2:$E$23,,LOOKUP(2^15,SEARCH(G$21,$B$1:$E$1)*SEARCH($F22,$B$1:$E$1),COLUMN($B$1:$E$1)-MIN(COLUMN($B$1:$E$1))+1)))

    In H22 and copy down:

    =AVERAGE(INDEX($B$2:$E$23,,LOOKUP(2^15,SEARCH(H$21,$B$1:$E$1)*SEARCH($F22,$B$1:$E$1),COLUMN($B$1:$E$1)-MIN(COLUMN($B$1:$E$1))+1)))

    Regards

  7. #7
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Counting cells with numbers in the column that contains specific words

    It beautifully works for the column counting, but I haven't gotten it to work with calculating a mean.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells with numbers in the column that contains specific words

    Re-post then with your attempts at adding those formulas.

    Regards

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Counting cells with numbers in the column that contains specific words

    I had no idea it was the name of a band!

    I was quoting Johnny Dangerously.


    Count

    =SUMPRODUCT((ISNUMBER(SEARCH($A26,$B$1:$E$1)))*(ISNUMBER(SEARCH(B$25,$B$1:$E$1)))*($B$2:$E$18<>""))

    Mean

    =SUMPRODUCT((ISNUMBER(SEARCH($A26,$B$1:$E$1)))*(ISNUMBER(SEARCH(C$25,$B$1:$E$1)))*($B$2:$E$18))/
    SUMPRODUCT((ISNUMBER(SEARCH($A26,$B$1:$E$1)))*(ISNUMBER(SEARCH(C$25,$B$1:$E$1)))*($B$2:$E$18<>""))



    Edit: INDEX with a nexted LOOKUP? Mind = Blown
    Attached Files Attached Files
    Last edited by daffodil11; 05-09-2014 at 05:34 PM.

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells with numbers in the column that contains specific words

    Is this thread trying to win the prize for "Most Creative Workbook Names" or what??

  11. #11
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Counting cells with numbers in the column that contains specific words

    You are definitely right on the participant amount. Counting is hard.

    Just plugged in the formula and it is truly marvelous.

    http://img.pandawhale.com/65402-dear...ugatu-Zmxe.gif

    I am pretty much just starting out with excel, so I'll be spending quite a bit of time tweaking the formula to my real data set and trying to figure out what the function actually means.


    Thanks a lot!

  12. #12
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Counting cells with numbers in the column that contains specific words

    They both work!

    Thanks guys, you were way quicker and more helpful than the rest of my colleagues.

    Cheers


    now I just have to find how to change this to a "solved" topic...

+ 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. [SOLVED] How to sum up specific numbers and words in different cells
    By redtie in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-03-2012, 07:40 AM
  3. Replies: 3
    Last Post: 04-26-2011, 11:57 AM
  4. Counting Specific words in cells
    By dandavis1 in forum Excel General
    Replies: 3
    Last Post: 04-01-2010, 05:05 AM
  5. Counting Specific words in a column
    By Daniel1234 in forum Excel General
    Replies: 8
    Last Post: 03-10-2010, 05:56 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