+ Reply to Thread
Results 1 to 8 of 8

Thread: Counting up how many different values are in a column?

  1. #1
    Forum Contributor
    Join Date
    09-23-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    166

    Counting up how many different values are in a column?

    Evening,

    I have a column which contains about 900 entries/names, out of these 900 entries some are duplicates. I'm looking for a formula that will count the number of different values, e.g. not count duplicates.

    Any suggestions would be greatfully appreciated.

    Many thanks
    Last edited by Cmorgan; 01-28-2012 at 03:38 AM.

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: Counting up how many different values are in a column?

    Hi Cmorgan,

    Quickest way would probably be to select the range of cells, then using Advanced Filter copy the list and paste unique values to another column. It would then be easy to use a COUNTA function on that new range to show you how many values exist.

  3. #3
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057

    Re: Counting up how many different values are in a column?

    For data in A2:A1000 try this formula

    =SUMPRODUCT((A2:A1000<>"")/COUNTIF(A2:A1000,A2:A1000&""))
    Audere est facere

  4. #4
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: Counting up how many different values are in a column?

    Nice one DDL. Figured out the &"" bit accounts for blanks in the range.

  5. #5
    Forum Contributor
    Join Date
    09-23-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Counting up how many different values are in a column?

    Thanks this works a treat, just to complicate matters, using your formula of:

    =SUMPRODUCT((Input!C:C<>"")/COUNTIF(Input!C:C,Input!C:C&""))

    is there anyway to adapt this so it only does this is B4 is in column H?

    Many thanks

  6. #6
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: Counting up how many different values are in a column?

    Do you mean only do this calculation if the value in cell B4 is found somewhere in column H? If so, try..

    =IF(ISNUMBER(MATCH(B4,H:H,0)),SUMPRODUCT((Input!C:C<>"")/COUNTIF(Input!C:C,Input!C:C&"")),"")

  7. #7
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Counting up how many different values are in a column?

    if you are looking to count unique entries in Column C, if column H = B4, if so try this,

    =SUMPRODUCT(--(C2:C1000<>""),--(H2:H1000=B4),--(MATCH(C2:C1000&"_"&H2:H1000,C2:C1000&"_"&H2:H1000,0)=ROW(C2:C1000)-ROW(C2)+1))

    Do not use whole column reference like C:C, use a dynamic range instead or limit the range.
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  8. #8
    Forum Contributor
    Join Date
    09-23-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Counting up how many different values are in a column?

    Thanks guys, this is perfect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0