+ Reply to Thread
Results 1 to 6 of 6

Count of line items (Unique one, which is extracted after removing duplicates) from column

  1. #1
    Registered User
    Join Date
    06-01-2021
    Location
    Pune,India
    MS-Off Ver
    2016
    Posts
    62

    Count of line items (Unique one, which is extracted after removing duplicates) from column

    Hi,

    I have list of line items in columns which is repetitive in nature. I want to count the number of unique items from list. Here unique as in not the one which is only once in the column but unique = count of items ( after removing duplicates).

    Can someone please help me.

    Thanks

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,034

    Re: Count of line items (Unique one, which is extracted after removing duplicates) from co

    In Excel 365 / 2019+, you would just use

    =COUNTA(UNIQUE(Range))

    In 2016-, array-enter (enter using Ctrl-Shift-Enter)

    =SUM(1/COUNTIF(Range,Range))

    like

    =SUM(1/COUNTIF(A2:A1000,A2:A1000))

    Do not use the entire column, or include blanks in the range passed to the formula.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-01-2021
    Location
    Pune,India
    MS-Off Ver
    2016
    Posts
    62

    Re: Count of line items (Unique one, which is extracted after removing duplicates) from co

    Hi Bernie,

    Thanks for the response.

    This formula gives me unique list of line items. I am looking for line items (which is unique also and items listed multiple times). Sorry if I confused you.

    Thank you.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,530

    Re: Count of line items (Unique one, which is extracted after removing duplicates) from co

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,034

    Re: Count of line items (Unique one, which is extracted after removing duplicates) from co

    There are a number of techniques to extract the unique values (or distinct values, as some refer to them) from a list.

    The first is to use Advanced Filters - select your list of values, then choose the Data tab, then "Advanced" from the sort and filter section, and choose the "Copy to another location" and "Unique records only" options.

    The second is to insert a pivot table and use your values as the row data - if you want a count of each, then re-use your values in the data ares.

    The third is to use a column of formulas, like this to highlight the first value of each instance in column A, with the formula in cell B2:

    =IF(COUNTIF($A$2:A2,A2)=1,MAX($B$1:B1)+1,"")

    Copy that down, then use this formula

    =IFERROR(INDEX(A:A,MATCH(ROW(A1),B:B,False)),"")

    and copy down until the formula return blanks.

    Then there are a ton of VBA methods....

  6. #6
    Registered User
    Join Date
    06-01-2021
    Location
    Pune,India
    MS-Off Ver
    2016
    Posts
    62

    Re: Count of line items (Unique one, which is extracted after removing duplicates) from co

    Hi thanks for the suggested formula, this works

+ 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. List of extracted unique values creates duplicates (?!)
    By excelboo7891 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-17-2018, 05:12 PM
  2. Removing Duplicates in ColA Keep Unique Data in Column AC
    By Ijustneedsomething in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2017, 09:23 AM
  3. [SOLVED] Count duplicates and unique items
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2015, 02:31 AM
  4. [SOLVED] Count Unique Items in a Column Based on Unique Items in Two Other Columns
    By HangMan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2015, 04:48 PM
  5. [SOLVED] Count the number of Unique Items in a Column for each Unique Item in another Column
    By HangMan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2015, 01:18 PM
  6. Replies: 5
    Last Post: 02-21-2013, 11:37 AM
  7. [SOLVED] Count number of unique items in a column that contains duplicates
    By Steembeem in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2005, 09: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