+ Reply to Thread
Results 1 to 8 of 8

How to count distinct values in Excel

  1. #1
    Registered User
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007,2013
    Posts
    63

    How to count distinct values in Excel

    Hello Everyone,

    I have a sheet contains 30,000 rows. I need to determine the number of distinct (unique) values in column A. What is the most efficient way to do this in Excel?

    For example, I can pull the data into Access and use a select query to "group by" column A to get the answer. But I need to get the answer within
    Excel.


    Thanks
    Arpita

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: How to count distinct values in Excel

    Data > remove duplicates

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: How to count distinct values in Excel

    Pivot Table would be an easy option!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: How to count distinct values in Excel

    You can select all the items in column A, then click Data | Advanced on the Sort & Filter group, then in the dialogue box click against Copy to another location, type the first cell in the Copy to box (e.g. M1), click against Unique Records only, then click OK.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    07-12-2012
    Location
    Bethlehem, PA
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: How to count distinct values in Excel

    Are you looking to count the unique values (values that occur only once) or the distinct number of values (the total number of different values in the data)?

    For the first: =IF(COUNTIF($A$1:$A$30000,A1)=1,1,0) and then sum
    For the second: =IF(COUNTIF($A$1:A30000,A1)>1,0,1) and then sum

    Although pivot tables are the easiest option for both.

  6. #6
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: How to count distinct values in Excel

    This will give you the count of unique values. It is an array formula so it must be entered using CTRL+SHIFT+ENTER instead of just ENTER.
    Please Login or Register  to view this content.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  7. #7
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: How to count distinct values in Excel

    This also works as a non array entered formula:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007,2013
    Posts
    63

    Re: How to count distinct values in Excel

    I am really happy to see the lot of responses and ways to do one thing in Excel and I really appreciate this forum where we can learn Excel from commendable users.

    Thanks everyone.

+ 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. count distinct values in excel
    By annux08 in forum Excel General
    Replies: 3
    Last Post: 07-13-2015, 09:21 AM
  2. [SOLVED] Excel - Count distinct occurences and copy unique values
    By random0munky in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-26-2015, 10:41 PM
  3. How to Count Distinct Values in Excel
    By kisanvikas2015 in forum Excel General
    Replies: 2
    Last Post: 05-19-2015, 10:12 AM
  4. Count Distinct Values
    By trevordsmith in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2014, 09:21 PM
  5. [SOLVED] Count Distinct Values OFFSET
    By GregM56 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2013, 10:13 AM
  6. [SOLVED] Count Distinct Values
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-20-2012, 07:39 AM
  7. 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