+ Reply to Thread
Results 1 to 4 of 4

Count and show the occurrence of a text only if present

  1. #1
    Registered User
    Join Date
    02-23-2016
    Location
    Switzerland
    MS-Off Ver
    MSOffice 2010
    Posts
    4

    Count and show the occurrence of a text only if present

    Hi guys, I have a table where in the first column there is a list of codes, selected from a drop down menu.
    The codes are the abbreviation of the actual item's name.
    I would like at the bottom of the table to count how many times all selected codes and only the selected codes appear, but showing their count with their complete name.
    For example, my validation data list is "a" (apple), "b" (banana), "p" (pear), "m" (mango), "s" (strawberry)
    In column A only "p" and "m" have been selected multiple times then appear.
    I would like to only have these two items' count at the bottom of the table, so to show: pear 2, mango 3

    I hope my question is clear enough.
    Is this possible?

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Count and show the occurrence of a text only if present

    With validation list in column D try these array-entered formulas. In B13 and filled down until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in C13 filled down until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.


    Row\Col
    A
    B
    C
    D
    E
    1
    Codes
    2
    m apple
    3
    s banana
    4
    l kiwi
    5
    b lime
    6
    m mango
    7
    p pear
    8
    y strawberry
    9
    z
    10
    p
    11
    m
    12
    13
    mango
    3
    In B13
    14
    pear
    2
    {=IFERROR(INDEX($D$2:$D$8,SMALL(IF(COUNTIF($A$2:$A$11,LEFT($D$2:$D$8))>1,ROW($D$2:$D$8)-MIN(ROW($D$2:$D$8))+1),ROWS($1:1))),"")}
    15
    in C13
    16
    {=IFERROR(INDEX(COUNTIF($A$2:$A$11,LEFT($D$2:$D$8)),SMALL(IF(COUNTIF($A$2:$A$11,LEFT($D$2:$D$8))>1,ROW($D$2:$D$8)-MIN(ROW($D$2:$D$8))+1),ROWS($1:1))),"")}
    Dave

  3. #3
    Registered User
    Join Date
    02-23-2016
    Location
    Switzerland
    MS-Off Ver
    MSOffice 2010
    Posts
    4

    Re: Count and show the occurrence of a text only if present

    Thank you for your reply FlameRetired, but my knowledge of Excel is too limited and I don't really understand it.
    It looks like it may be not exactly what I am looking for however.
    I am looking for something like this:
    Untitled.png
    where in row 17, 18, 19 column b and c I have as a result what I have now manually written in red.
    Thank you for your time!

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Count and show the occurrence of a text only if present

    You are welcome.
    Unfortunately my browser will not permit me to see *.png files posted here.

    You have the option of uploading a representative Excel workbook on this forum.

    If you are interested click on FAQ, then click on Reading and posting Messages under the Board FAQ. There are more lists of options including RE: attachments. Click that and follow the instructions.

+ 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 the occurrences of a string and show occurrence No.
    By gdallas in forum Excel General
    Replies: 2
    Last Post: 01-20-2016, 07:53 AM
  2. [SOLVED] count and sum occurrence against a value
    By koshur in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2015, 02:46 AM
  3. [SOLVED] Count number of days since last text occurrence
    By Verifyor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-21-2014, 11:24 AM
  4. Need a formula to count occurrence of text and calculate a sum total
    By tgaito in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2014, 01:55 PM
  5. [SOLVED] Count Occurrence Of Text Within Individual Cell And Cell Range
    By jhudson444 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-06-2013, 09:06 PM
  6. Replies: 1
    Last Post: 08-14-2013, 10:41 PM
  7. Replies: 4
    Last Post: 03-29-2012, 09:01 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