+ Reply to Thread
Results 1 to 12 of 12

Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

  1. #1
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Question Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Hi all,

    On the attached sheet I have a column of emails (in my real version, this column could contain up to 500k or more emails).

    I know how to count the number of emails in the column BUT many are doubled.

    I want to add a SINGLE CELL FORMULA in cell D2 which will count the number of unique email values in the entire column A.

    I don't want to add a filter in column B and count that.

    Can this be done please? Played with several SUMPRODUCT ideas via Google but most 'freeze' up due to process weight.

    Thanks in advance,

    Ian
    Attached Files Attached Files

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Hi,

    In your example sheet, you could use this,

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    more generally, for an unknown number of entries...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,699

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Try

    =SUMPRODUCT(1/COUNTIF(A2:A30,A2:A30))

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    You could also do it this way which may be better from a resource point of view:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    In your example, try:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  6. #6
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Thanks all - first try was this;

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Which, when I apply to whole column by tweaking thus;

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Freezes and returns a zero value eventually - as in OP - I need something to apply to whole column and had tried this which didn't work but thanks for suggesting this.

    Will try the other solutions next.... standby...
    Last edited by iantix; 04-25-2017 at 11:50 AM.

  7. #7
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    @sweep - I tried this one on my live data set;

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And the sheet just hung while calculating (note - my live data, the emails are in column C but I did make all changes, to no avail).

    OOI - what does the 'zzzzz' represent?

  8. #8
    Registered User
    Join Date
    04-19-2017
    Location
    Manchester, England
    MS-Off Ver
    Excel 2013, Office 365, Windows 10
    Posts
    14

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Hi Ian - I know you've asked for a formula in a single cell and other contributors are attempting that, but I've come up against this issue before and didn't get anywhere with formulae.

    This snippet of code will work, though, and it shouldn't matter too much how many rows are involved.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    @thiefofthings - thanks for this - I suspected that the formula path may be tricky so thanks for confirming what Google results had me fearing.

    If I want to run this on column C, as opposed to A, just need to alter the column references to A in the VBA yes?

  10. #10
    Registered User
    Join Date
    04-19-2017
    Location
    Manchester, England
    MS-Off Ver
    Excel 2013, Office 365, Windows 10
    Posts
    14

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Quote Originally Posted by iantix View Post
    @thiefofthings - thanks for this - I suspected that the formula path may be tricky so thanks for confirming what Google results had me fearing.

    If I want to run this on column C, as opposed to A, just need to alter the column references to A in the VBA yes?
    Yep, just change from A to C, and you end up with this:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    And it works perfectly! Thank you @thiefofthings - had to use column ZZ instead of M (which is used on my real sheet).

  12. #12
    Registered User
    Join Date
    04-19-2017
    Location
    Manchester, England
    MS-Off Ver
    Excel 2013, Office 365, Windows 10
    Posts
    14

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    no worries

+ 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] Unique values to a single column -- formula constraints
    By macrorookie in forum Excel General
    Replies: 1
    Last Post: 09-01-2016, 02:40 AM
  2. Replies: 2
    Last Post: 06-16-2016, 08:09 PM
  3. Replies: 6
    Last Post: 05-26-2016, 11:12 PM
  4. [SOLVED] Detect unique values in cell and find them in column to count them
    By Ivancitomusic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-02-2015, 02:37 PM
  5. Replies: 9
    Last Post: 10-14-2013, 07:55 PM
  6. Fetch Unique values from a single column
    By Sherlyn Rachel in forum Excel General
    Replies: 3
    Last Post: 03-23-2011, 08:05 AM
  7. Transpose unique values in one column/mult. rows into a single row
    By Wil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2005, 04:06 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