+ Reply to Thread
Results 1 to 7 of 7

Distinct Count

  1. #1
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Distinct Count

    Hi I am looking to do a distinct count of products purchased. Then distinct count of products purchased > 0

    Sheet attached, MQ
    Attached Files Attached Files
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Distinct Count

    Are the product codes really numbers as demonstrated in your file?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Distinct Count

    Fair Qn, yes they are.

    MQ

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Distinct Count

    Try these array formulas**:

    I6:

    =SUM(IF(FREQUENCY(IF(A$2:A$95=H6,B$2:B$95),B$2:B$95),1))

    J6:

    =SUM(IF(FREQUENCY(IF((A$2:A$95=H6)*(C$2:C$95>0),B$2:B$95),B$2:B$95),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Select I6:J6 and copy down as needed.

  5. #5
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Distinct Count

    Thx tony, that is working well. Is there a restriction on the number of records I can search through.

    I.e I have edited your formula to =SUM(IF(FREQUENCY(IF(A$2:A$23000=H6,B$2:B$23000),B$2:B$23000),1))

    and it returns N/A

  6. #6
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Distinct Count

    All good, I had some rubbish data in there holding up the process!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Distinct Count

    Good deal. Thanks for the feedback!

+ 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. How to count distinct value
    By Ankit_Kumar in forum Excel General
    Replies: 1
    Last Post: 06-22-2015, 03:19 AM
  2. Count distinct in excel
    By akshaykadidal in forum Tips and Tutorials
    Replies: 3
    Last Post: 01-07-2014, 08:20 AM
  3. [SOLVED] Sumproduct & Count Distinct
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-26-2013, 12:00 PM
  4. Distinct count using vba
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2012, 07:54 AM
  5. Count distinct?
    By Africa in forum Excel General
    Replies: 4
    Last Post: 12-09-2011, 08:34 AM
  6. Count Distinct Query
    By jello1000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-22-2007, 07:28 PM
  7. Count Distinct only
    By John Moore in forum Excel General
    Replies: 4
    Last Post: 11-25-2005, 07:50 AM

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