+ Reply to Thread
Results 1 to 5 of 5

Count Distinct Values

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 365
    Posts
    16

    Count Distinct Values

    Hi,

    I need to perform a count of distinct values in a column and display both the count as well as the distinct value that it is counting.

    e.g. if I had 5 entries in A1-> A5 of AA, BB, CC, BB, AA

    I would want the results to show
    AA - 2
    BB - 2
    CC - 1

    How do I do this?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: Count Distinct Values

    One way would be to use an Advanced Filter to extract a list of unique entries and then use COUNTIF.

    Alternatively, and probably quicker, you could use a Pivot Table.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Count Distinct Values

    Hi,

    Here's one way of doing this..

    Refer workbook attached. You need to use this as an array formula (confirmed by pressing Ctrl + Alt + Enter after inputting the formula).
    Attached Files Attached Files
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Count Distinct Values

    Quote Originally Posted by Saarang84 View Post


    Refer workbook attached. You need to use this as an array formula (confirmed by pressing Ctrl + Alt + Enter after inputting the formula).
    You mean Ctrl + Shift + Enter. Right?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Count Distinct Values

    Yes sktneer, you're right, Its my mistake..

+ 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] How to count distinct values in a column
    By marchandoj in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2014, 12:23 PM
  2. [SOLVED] Count Distinct Values OFFSET
    By GregM56 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2013, 10:13 AM
  3. [SOLVED] Count Distinct Values
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-20-2012, 07:39 AM
  4. Count distinct values with criteria
    By greencardioid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-29-2008, 06:48 PM
  5. Count Distinct Values?
    By bill_morgan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-26-2005, 10:06 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