+ Reply to Thread
Results 1 to 9 of 9

Return unique list from a column based on a criteira from another column

  1. #1
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Return unique list from a column based on a criteira from another column

    Hi all,

    I have been searching for help on this for a while but, have drawn a blank.

    One on sheet I have a column with data that could be duplicated. In another sheet I want to pull through a unique list (i.e. it only retrieves one of each value) from this column based on if another column contains part of a word (so "Example*")

    I have found a couple of formulas in formulas but it either only returns the first value or completes the "iter" function. I am unable to upload an example but, can later if needs be.

    Column A...Column B
    Test 1........A
    Test 2........A
    Test 1........A
    Test 1........B
    Test 1........C
    Test 1........C
    Test 1........B
    Test 2........D

    So, if I want to return a list from column B based on the criteria for column A, so if I selected Test 1 as the condition the results would be: -

    A
    B
    C

    Sorry if I have not explained that very well but, help would be very much appreciated as I am stuck!

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Return unique list from a column based on a criteira from another column

    This should work:

    Array entered, Ctrl+Shift+Enter instead of regular Enter
    =INDEX($B$2:$B$8, MATCH(0, IF($E$2=$A$2:$A$8, COUNTIF($F$1:$F1, $B$2:$B$8), ""), 0))

    You can wrap it in a IFERROR to take care of errors

  3. #3
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: Return unique list from a column based on a criteira from another column

    Hi,

    I seem to be getting the same errors that I have previously. The condition I am searching for is slightly variable so, rather than it pointing to a specific cell for the condition look up I need to be able to type "Test 1*", will this make any difference?

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Return unique list from a column based on a criteira from another column

    Untested, try :

    =INDEX($B$1:$B$8, SMALL(IF(ISNUMBER(SEARCH($E$2, $A$1:$A$8)), MATCH(ROW($A$1:$A$8), ROW($A$1:$A$8))), ROWS($C$1:C1)))

    But the wildcard is unnecessary. Array entered as well.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Return unique list from a column based on a criteira from another column

    Try this
    Enter array formula in D2 and drag formula down and across

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D E
    1 Test 1 Test 2
    2 Test 1 A A A
    3 Test 2 A B D
    4 Test 1 A C
    5 Test 1 B
    6 Test 1 C
    7 Test 1 C
    8 Test 1 B
    9 Test 2 D
    Attached Files Attached Files
    Last edited by AlKey; 05-24-2018 at 10:36 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: Return unique list from a column based on a criteira from another column

    Hi,

    So this formula works brilliantly for the first group of the column but, I could have some values in column A that say for example "Test 1 - Other". These aren't pulling through on the formula?

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Return unique list from a column based on a criteira from another column

    Quote Originally Posted by elleb View Post
    Hi,

    So this formula works brilliantly for the first group of the column but, I could have some values in column A that say for example "Test 1 - Other". These aren't pulling through on the formula?
    It is your direct responsibility to provide timely and accurate requirements. "Test 1 - Other" is not present in your data set.

    v A B C D E F
    1 Test 1 Test 2 Test 1 - Other
    2 Test 1 A A A E
    3 Test 2 A B D F
    4 Test 1 A C G
    5 Test 1 B
    6 Test 1 C
    7 Test 1 C
    8 Test 1 B
    9 Test 2 D
    10 Test 1 - Other E
    11 Test 1 - Other E
    12 Test 1 - Other F
    13 Test 1 - Other G
    14 Test 1 - Other G
    Last edited by AlKey; 05-24-2018 at 10:55 AM.

  8. #8
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: Return unique list from a column based on a criteira from another column

    Hi,

    I did make reference to it in the original post: -

    "from this column based on if another column contains part of a word (so "Example*")" however I did not use it in the example, I apologise.

    Thanks for the update but unfortunately I need it as one list so, the text will always start with Test but could have additional text at the end. Which is why I am trying to use the "Test*" wildcard.

    Again thanks for all the help so far.

  9. #9
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126
    Hi, thanks for the reply. Formula is working well, it's just the issue around the potential additional text that's stopping it working completely.

    I might have to find another way around it!

    Thanks again!

+ 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: 7
    Last Post: 01-25-2018, 08:06 PM
  2. [SOLVED] Create List of Unique values based on data from another column
    By yettie10ff in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-09-2017, 12:18 PM
  3. [SOLVED] VBA Creating a list of unique values from one column based on criteria from another column
    By bilbo85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2016, 02:38 PM
  4. Return Multiple Text Reslts Sorted Based Unique Values in another Column
    By Fin Fang Foom in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-10-2015, 12:01 AM
  5. [SOLVED] Return list of items from column based on another column value
    By justinr in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-03-2014, 11:25 AM
  6. Pulling unique list based on items in first column
    By harryS81 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-07-2014, 05:18 AM
  7. [SOLVED] Return unique values based on another column's value
    By bd528 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-26-2013, 04:02 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