+ Reply to Thread
Results 1 to 4 of 4

Count instances in a data (Countif? )

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Count instances in a data (Countif? )

    Hi guys,

    I would like to ask whether someone can help me with analyzing a set of data. For ease of reference I attached a test data set

    I have a long list of data consisting of two columns:
    - date
    -amount of fruits sold.

    I would like to come up with a formula (or maybe pivot?) which would show the number of fruit sold on a particular day.

    E.g. If on 5-10-2017 I sold 2 banana and 1 apple. I would like to have a formula which counts the instances of types of fruit sold on that day. That is 2 (bananas and apples)
    E.g2: If on 6-10-2017 I sold 3 apples, 2 oranges, 1 banana. I would like to have a formula which counts the instances of types of fruit sold on that day. That is 3 (oranges, bananas and apples)

    If not complicated it would also be great to list what fruit was sold next to the no.of instances.

    Can someone please help.

    As always much appreciated guys!!

    Regards

    Keibri
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Count instances in a data (Countif? )

    H4, copied down:
    =SUM(INDEX(($C$4:$C$24=G4)*($B$4:$B$24<>"")/COUNTIFS($C$4:$C$24,$C$4:$C$24&"",$B$4:$B$24,$B$4:$B$24&""),0))

    I4, copied across and down:
    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$4:$B$16)/(($C$4:$C$16=$G4)*(COUNTIF($H4:H4, $B$4:$B$16)=0)),1)),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: Count instances in a data (Countif? )

    Wow man! just wow! I'm mind blown.

    It worked wonder. I m really grateful. To be honest, my data consists of approximately 10,000 lines (so that was amazing) and it worked wonder!!! Thanks a lot!!!!

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Count instances in a data (Countif? )

    It might be a bit slow over that no. of lines, but it'll get there.

    You're welcome and thanks for the rep.

+ 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] Using COUNTIF to count multiple instances of data in a single cell
    By emsterv in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2017, 06:50 PM
  2. Count the last X instances of a value, from auto-filtered data
    By QPRMinty in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2016, 05:05 AM
  3. Count instances of specific text within source data
    By Tarheel8181 in forum Excel General
    Replies: 4
    Last Post: 06-23-2016, 11:38 AM
  4. [SOLVED] Using SUMIF and COUNTIF to calculate number of particular instances against one team
    By ajw1982 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-14-2013, 04:23 AM
  5. Replies: 2
    Last Post: 01-05-2012, 08:36 AM
  6. Using Countif to return un-duplicated instances
    By dforte in forum Excel General
    Replies: 8
    Last Post: 11-19-2010, 09:07 PM
  7. [SOLVED] RE: Countif function for instances of text string contained
    By David Billigmeier in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-10-2005, 05:05 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