+ Reply to Thread
Results 1 to 9 of 9

Find unique values from a range using formula?

  1. #1
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Find unique values from a range using formula?

    I use the following formula in Google Sheets to find unique values from a column. How could I do the same for a range like A:D?

    =ARRAYFORMULA(IFERROR(INDEX($C$2:$C, MATCH(0,IF(ISBLANK($C$2:$C),1,COUNTIF($B$1:B1, $C$2:$C)), 0)),""))

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Find unique values from a range using formula?

    Not sure this would work on an array like that, but you could replace that array formula with this regular formula...
    =IFERROR(INDEX($C$2:$C$60,MATCH(0,INDEX(COUNTIF($B$1:B1,$C$2:$C$60),0,0),0)),"")

    Adjust ranges as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Find unique values from a range using formula?

    not sure about Google sheets, but here's one way in Excel...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: Find unique values from a range using formula?

    Quote Originally Posted by Glenn Kennedy View Post
    not sure about Google sheets, but here's one way in Excel...
    Thanks. It works in Google Sheets. Unfortunately my list will be ever expanding and needing that J column would be limiting.

  5. #5
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: Find unique values from a range using formula?

    Quote Originally Posted by FDibbins View Post
    Not sure this would work on an array like that, but you could replace that array formula with this regular formula...
    =IFERROR(INDEX($C$2:$C$60,MATCH(0,INDEX(COUNTIF($B$1:B1,$C$2:$C$60),0,0),0)),"")

    Adjust ranges as needed
    Correct me if I"m wrong but it seems like this only working when the range is confined to a single column. If I expanded it as follows it didn't work for me.

    =IFERROR(INDEX($C$2:$E$10,MATCH(0,INDEX(COUNTIF($B$1:B1,$C$2:$E$10),0,0),0)),"")

    Example: https://docs.google.com/a/advantagep...it?usp=sharing

  6. #6
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: Find unique values from a range using formula?

    Well, I found this formula at http://www.extendoffice.com/document...e-columns.html

    It works over a multi column range but when I try and range the range from $A$2:$C$9 to $A$2:$C$10 it gives me an error

    Here's the link (different from the one above): https://docs.google.com/spreadsheets...it?usp=sharing

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find unique values from a range using formula?

    Hi.

    The solution I give here will work for any number of columns, not just 4, though it also returns an alphabetical list, which may not be what you require.

    http://excelxor.com/2014/11/08/uniqu...veral-columns/

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find unique values from a range using formula?

    Edit: in fact, if your data is purely numerical (you don't say), this solution can be made even more succinct.

    Regards

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Find unique values from a range using formula?

    ha... That's maybe 'cos I forgot to delete three un-needed columns. Take a second look at this effort!!
    Attached Files Attached Files

+ 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] Formula or VBA - Comparison CSV Values between 3 cells for used range. Find unique values.
    By grphillips in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 06-09-2014, 02:12 PM
  2. [SOLVED] Find unique values from range ( populated cells only) & not count zeros or NA errors VBA
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2014, 06:50 AM
  3. Excel 2007 - Formula or VBA to find unique names and return values?
    By kjwaller in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2013, 09:09 PM
  4. [SOLVED] find unique values in a range that contains text and empty cells
    By bombicci in forum Excel General
    Replies: 4
    Last Post: 07-04-2012, 09:17 AM
  5. Find Unique Values In A Range
    By nevi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2008, 04:40 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