+ Reply to Thread
Results 1 to 8 of 8

Unique Values From All Columns Formula

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    15

    Unique Values From All Columns Formula

    Hello Dears,

    Please help me to get Unique Values From All Columns ASAP. I need to complete VERY VERY IMP task assignment.

    How can I get the result in the column Unique_Values_From_AllColumns using Excel Formula?

    Below is example. same example in attached Excel.
    a1 a1 a1 a1
    a2 a2 a2 a2
    a3 a3 a3 a3
    b4 c4 d4 e4
    b5 c5 d5 e5


    Result should be as below:

    a1
    a2
    a3
    b4
    b5
    c4
    c5
    d4
    d5
    e4
    e5
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Unique Values From All Columns Formula

    This is done using an Excel Collection.

    http://dailydoseofexcel.com/archives...h-collections/

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Unique Values From All Columns Formula

    Hi nandkishorskale,

    Welcome to the forum!.

    Please find the attached workbook as requested.

    Regards,
    Joshi
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Unique Values From All Columns Formula

    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    09-05-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Unique Values From All Columns Formula

    Quote Originally Posted by krjoshi View Post
    Hi nandkishorskale,

    Welcome to the forum!.

    Please find the attached workbook as requested.

    Regards,
    Joshi
    Thanks a lot for your wishes Joshi saheb!
    Thanks for the solution.
    just 2 doubts.
    1. Currently results are as below as per Excel provided by you.
    Unique_Values_From_AllColumns
    a1
    a1
    a1
    a1
    a2
    a2
    a2
    a2
    a3
    a3
    a3
    a3
    b4
    c4
    d4
    d4
    b5
    c5
    d5
    d5

    But I wanted the result as below
    a1
    a2
    a3
    b4
    b5
    c4
    c5
    d4
    d5
    e4
    e5

    2. Please tell, How we can increase the columns and rows of the range?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Unique Values From All Columns Formula

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    Data
    -----
    Count
    Uniques
    2
    I
    H
    R
    M
    A
    D
    R
    Z
    11
    I
    3
    H
    K
    A
    X
    G
    R
    V
    I
    H
    4
    R
    5
    M
    6
    A
    7
    D
    8
    Z
    9
    K
    10
    X
    11
    G
    12
    V
    13

    Enter this array formula** in J2. This will return the count of the unique entries in the range. This number will also be used for an error trap in the extraction formula.

    =SUM(IF(A2:H3<>"",1/COUNTIF(A2:H3,A2:H3)))

    Enter this array formula in K2. There must be a cell above the 1st formula cell and this cell must not contain an entry that is also in the data range.

    =IF(ROWS(K$2:K2)>J$2,"",INDEX(A$2:H$3,MIN(IF(A$2:H$3<>"",IF(ISNA(MATCH(A$2:H$3,K$1:K1,0)),ROW(A$2:H$3)-ROW(A$2)+1))),MOD(MIN(IF(A$2:H$3<>"",IF(ISNA(MATCH(A$2:H$3,K$1:K1,0)),(ROW(A$2:H$3)-ROW(A$2)+1)*10^5+(COLUMN(A2:H3)-COLUMN(A2)+1)))),10^5)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

  7. #7
    Registered User
    Join Date
    09-05-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Unique Values From All Columns Formula

    Thanks a lot Tony for this wonderful solution.
    This is perfectly working fine.
    But problem is that it cant handle 10 columns and 1 Lakh OR 50,000 of rows
    It keeps on calculating for hours.
    Do we have some solution which can handle this much of Data?


    Quote Originally Posted by Tony Valko View Post
    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    Data
    -----
    Count
    Uniques
    2
    I
    H
    R
    M
    A
    D
    R
    Z
    11
    I
    3
    H
    K
    A
    X
    G
    R
    V
    I
    H
    4
    R
    5
    M
    6
    A
    7
    D
    8
    Z
    9
    K
    10
    X
    11
    G
    12
    V
    13

    Enter this array formula** in J2. This will return the count of the unique entries in the range. This number will also be used for an error trap in the extraction formula.

    =SUM(IF(A2:H3<>"",1/COUNTIF(A2:H3,A2:H3)))

    Enter this array formula in K2. There must be a cell above the 1st formula cell and this cell must not contain an entry that is also in the data range.

    =IF(ROWS(K$2:K2)>J$2,"",INDEX(A$2:H$3,MIN(IF(A$2:H$3<>"",IF(ISNA(MATCH(A$2:H$3,K$1:K1,0)),ROW(A$2:H$3)-ROW(A$2)+1))),MOD(MIN(IF(A$2:H$3<>"",IF(ISNA(MATCH(A$2:H$3,K$1:K1,0)),(ROW(A$2:H$3)-ROW(A$2)+1)*10^5+(COLUMN(A2:H3)-COLUMN(A2)+1)))),10^5)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Unique Values From All Columns Formula

    Quote Originally Posted by nandkishorskale View Post
    But problem is that it cant handle 10 columns and 1 Lakh OR 50,000 of rows
    It keeps on calculating for hours.
    Do we have some solution which can handle this much of Data?
    I don't think a formula will be able to handle that much data. As you can see the formula is quite complex and calculation intensive even on a small range.

    Try posting a new thread in the Programming and Macros subforum. Let them know about this thread.

+ 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. Replies: 2
    Last Post: 07-17-2013, 10:42 AM
  2. Formula to check unique values based on data from 2 columns
    By notsobrilliant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-10-2013, 04:15 PM
  3. Replies: 1
    Last Post: 02-18-2013, 01:46 AM
  4. 3 columns: None contain unique values, but I need a list of every unique set
    By mathematician in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-15-2012, 04:47 PM
  5. Replies: 2
    Last Post: 03-27-2012, 06:00 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