+ Reply to Thread
Results 1 to 6 of 6

Extract list of unique values, only if they have specific text next to them.

  1. #1
    Registered User
    Join Date
    12-17-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    14

    Extract list of unique values, only if they have specific text next to them.

    Hello,

    I am using the following function to retrieve a list of unique values which is working fine:

    {D2=INDEX($A$1:$A$50, MATCH(0, COUNTIF($D$1:D1, $A$1:$A$50), 0))}

    However, I only wish to return the value if the value in A:A=>0

    So if it is something like

    A - 0
    B - 1
    C - 2
    D - 1

    Returns:

    B-1
    C-2
    D-1

    Despite A being a unique in this list, it is skipped because it's value is 0.

    I also would like it to not insert a blank in this case, I want it to be the next unique with a value.

    Thank you in advance.
    Last edited by Who_else; 11-10-2017 at 06:01 AM. Reason: SOLVED

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Extract list of unique values, only if they have specific text next to them.

    hi there. it's not very clear how your data looks like. i don't know if "A - 0" is inside the same cell or are you trying to use the dash to represent different columns. but try these 2 solutions. if they are in the same cell:
    =INDEX($A$1:$A$50, MATCH(0, IF(--(MID($A$1:$A$50,FIND("-",$A$1:$A$50)+2,LEN($A$1:$A$50)))>0,COUNTIF($D$1:D1, $A$1:$A$50)), 0))

    different cells:
    =INDEX($A$1:$A$50, MATCH(0, IF($B$1:$B$50>0,COUNTIF($D$1:D1, $A$1:$A$50)), 0))

    both are still array formulas. next time though, do upload an excel sample so that we do not have to manually key in your data to do a testing.

    input the desired results so that we don't have to second-guess if what we are doing is correct or not. you may look at my signature to upload an eg that is easier to understand.

    the upload attachment must be done by going to Go Advanced. click on Manage Attachments. Choose file, upload and close the window.

    if i really guessed it wrongly, please upload something according to my recommendations. try to use the solution i have given and we'll help to advise what went wrong.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract list of unique values, only if they have specific text next to them.

    I am not very clear what the data is or the mix or layout.

    This is also confusing. It sounds like a self contradiction.
    Despite A being a unique in this list, it is skipped because it's value is 0.

    I also would like it to not insert a blank in this case, I want it to be the next unique with a value.
    I took a guess. I also guessed that the number of rows is variable.

    This formula goes in C1 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    A
    B
    C
    1
    A
    5
    A
    2
    B
    0
    C
    3
    C
    2
    C
    4
    D
    3
    D
    5
    E
    5
    E
    6
    F
    1
    F
    Last edited by FlameRetired; 11-10-2017 at 01:56 AM. Reason: Typo
    Dave

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Extract list of unique values, only if they have specific text next to them.

    May be try

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


    Row\Col
    A
    B
    C
    D
    2
    A
    0
    B
    1
    3
    B
    1
    D
    3
    4
    C
    5
    D
    3


    Copy across !
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    12-17-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    14

    Re: Extract list of unique values, only if they have specific text next to them.

    Thank you so much,
    All of you,
    I apologise that I didn't attach something, normally I would, however due to the nature of the document I couldn't share it in it's current form

    The document was for work and contains incredibly private information,
    I tried to describe it as best I could and reading it back now I did so poorly, however you all came up with fantastic solutions, Shukla.ankur281190's was the solution I went with in the end and it worked flawlessly (with modifications as to the references of course)
    Essentially I had one sheet with peoples names on it and a possible value next to it which I needed to port to a second sheet that was cleaned of anyone without a value, only reporting a list of actionable clients.

    Serves me right for trying to find a solution 10 minutes before leaving work for the day.

    Again, Thank you.

    W.E

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract list of unique values, only if they have specific text next to them.

    Glad you found solution. Thank you for the feedback and for marking this thread Solved. It helps.

+ 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: 4
    Last Post: 01-04-2017, 07:29 PM
  2. [SOLVED] Extract a unique list that ignores a specific value
    By mateo315 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-21-2015, 02:07 PM
  3. Extract unique text values from a filtered list
    By ljerromes in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2015, 07:51 PM
  4. [SOLVED] automatically extract unique values from a list
    By labogola in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-07-2014, 10:54 AM
  5. [SOLVED] Extract unique values from a table and list along a row
    By doctorblyth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2013, 04:33 PM
  6. [SOLVED] Extract Unique Values from Long list and Put in Sorted Order
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-08-2013, 09:10 PM
  7. [SOLVED] Extract unique values out of list based on an extra criteria
    By sven1975 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 05: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