+ Reply to Thread
Results 1 to 9 of 9

Extract Unique Values from Lists INDEX function

  1. #1
    Registered User
    Join Date
    10-25-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    28

    Extract Unique Values from Lists INDEX function

    Hi everyone,

    Previously I have built an excel sheet that takes a user input and searches through three columns independently.

    I had used the same INDEX(SMALL(...SEARCH( ... ))) based function to find this input in each of the columns. I then tried to use an array function to derive the unique values. I tried both...

    =IFERROR(INDEX((...),MATCH(0,COUNTIF(...)),0)), "") as well as
    =IFERROR(INDEX((...),MATCH(0,IF(ISBLANK((...)),1,COUNTIF(...))),0)), "") to account for blank spaces. Neither seem to work and I think this is because I used multiple ranges.

    Any suggestions would be appreciated. Thank you!

    Ray
    Last edited by Ray Storm; 07-07-2015 at 09:46 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extract Unique Values from Lists INDEX function

    Okay, so we have this table from B3:F15 and we want to extract "unique values"? Unique in what sense? You said you expect 2,3,4,6 and 12 but, except the date, 2 and 4 look identical. Can you explain the criteria a bit more?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  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
    28,300

    Re: Extract Unique Values from Lists INDEX function

    Ray,
    It's not clear to me what your search criteria (in the example) are- could you explain please.

  4. #4
    Registered User
    Join Date
    10-25-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    28

    Re: Extract Unique Values from Lists INDEX function

    Sorry to be unclear! The new example below should be much easier to understand.

    I wanted to use a function to extract unique values from the ranges $J$5:$J$13,$J$15:$J$23,$M$5:$M$13. In my example Table 2 outputs 3, 6, 12; Table 3 outputs 12. Since 12 appeared twice, this value is unique only once. Thus the unique values are 3, 6, 12. (12 does not appear twice)

    Essentially the list is 2,3,4,6,12,3,6,12,12 and I would like to output only 2, 3, 4, 6, 12. I think one solution is that I create a single range by setting the cells equal. (Z5 = J5, Z6 = J6...) and apply my original function to a single range. (Just thought of this)

    Does this clarify?

    The only portion of the example that I am unable to get to work properly is B25:B38. Thank you!
    Last edited by Ray Storm; 07-07-2015 at 12:17 PM.

  5. #5
    Registered User
    Join Date
    10-25-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    28

    Re: Extract Unique Values from Lists INDEX function

    Please use this example. It should be much clearer. Thank you!
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extract Unique Values from Lists INDEX function

    I created a unique list in G using (in G4 copied down)
    =IF(ISNUMBER(MATCH("*"&$J$3&"*", $D4:$F4,0)),COUNT($G$3:$G3)+1,"")

    Then in B25 copied down
    =IFERROR(INDEX($B$4:$B$15, MATCH(ROWS($A$1:$A1), $G$4:$G$15,0)),"")
    Is that acceptable?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-25-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    28

    Re: Extract Unique Values from Lists INDEX function

    I never thought of accomplishing it using the method you developed! However, in the actual database I had created the orders are strings (containing text). If possible, I would like to apply a function without needing to add additional columns to the physical database which is stored across several workbooks.

    One method that I had discovered, I implemented in the following example. I was just hoping to apply the function directly. Thank you for the help!

    Regards,
    Ray
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extract Unique Values from Lists INDEX function

    This is very different. In the first example, each row represented a unique record, whether the criteria appeared in D,E, or F. In this example, each cell represents a unique record so you can pull multiple records from the same row.

    You said that the database is stored across several workbooks. Can you give an example of that, using separate worksheets instead of workbooks. Also, if you will be working with strings, best to have your example in strings.

  9. #9
    Registered User
    Join Date
    10-25-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    28

    Re: Extract Unique Values from Lists INDEX function

    Sorry if my example was too unclear. I have managed to figure out a solution to my problem

    This link helped me adjust my original function: http://www.get-digital-help.com/2009...umns-in-excel/

+ 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. Extract and create unique lists
    By Joynesy in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-15-2014, 05:36 PM
  2. [SOLVED] Extract Unique Values from Multiple Lists
    By sskgintl in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-27-2013, 06:46 PM
  3. [SOLVED] Extract an unique list from 2 different lists without duplicates
    By akalien in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-06-2012, 06:09 AM
  4. Using MATCH and INDEX to extract unique values
    By jg70124 in forum Excel General
    Replies: 1
    Last Post: 05-17-2006, 03:10 PM
  5. [SOLVED] Extract Unique Records from two lists
    By MarkN in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2005, 09:15 AM

Tags for this Thread

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