+ Reply to Thread
Results 1 to 15 of 15

Unique values in a list

  1. #1
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Unique values in a list

    Hi all

    How can I get a unique list of names on to a sheet that is based on data available from another sheet in the same workbook where the names may be repeated multiple times. I've tried to use the formula below which I obtained from another site but I can't make it work. I have substituted 'List_with_duplicates' with a name range and entered it as an array formula but I can't make it work. Any help appreciated. I'm using Excel 2010.

    {=IFERROR(INDEX(List_with_duplicates,SMALL(IF(FREQUENCY(MATCH(List_with_duplicates,List_with_duplicates,0),MATCH(List_with_duplicates,List_with_duplicates,0))>0,ROW(INDIRECT("1:"&ROWS(List_with_duplicates)))),ROWS($1:1))),"")}

    Many thanks

    John

  2. #2
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Unique values in a list

    for a one-time operation, it is best to use seeded Remove Duplicate function available through Data tab > Data Tools group on the menu ribbon.

    for recurring need, you can utilise the following regular / non-array formula:

    Please Login or Register  to view this content.
    if your data containing duplicate values are in Sheet1!A1:A10, and you want the unique values extracted on Sheet2, then, start on cell A2 in Sheet2 - either leave Sheet2!A1 blank or use a header value that is not a value expected to be found in your original data set on Sheet1!A1:A10.
    Last edited by icestationzbra; 10-16-2012 at 02:12 AM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Maldives
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Unique values in a list

    Oh Come on..!

    2 Suggestion

    01.Just matter of copying all your data and past new sheet then goto DATA tab there is a option called Remove Duplicates..

    02.On you are List apply conditional formatting there is called highlight unique then put filter on your list then filter based on color .. you can see unique list can copy and past new worksheet as well (values only recommeneded)

    Hope this will help you

  4. #4
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    Thanks for your help guys, I should have mentioned that the list that I am trying to get the unique values from is forever being added to so what I need is a dynamic way of updating my unique list whenever the main list changes. Can I use a name range that includes the whole column?

    Thanks again

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Unique values in a list

    certainly, you can!

    let's say your Named Range is "full_list", then the formula would become:

    =IFERROR(INDEX(full_list,MATCH(0,INDEX(COUNTIF(Sheet2!$A$1:A1,full_list),0),0)),"-")

    just keep on drag-filling down to as many rows as you please. once you add new names to your original list, unique values should keep appearing in the formulaically generated list in all the cells where formula has been drag-filled down.
    Last edited by icestationzbra; 10-16-2012 at 12:08 AM.

  6. #6
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    Thanks for that I'll give it a try and come back to you later. I'm impressed with the fast response. Excellent forum.

    All the best.

  7. #7
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    Thanks Icestationzebra, I have another question what does COUNTIF(Sheet2!$A$1:A1 refer to? I might be a bit slow with this one.

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Unique values in a list

    in the context of the formula, the COUNTIF is being used to determine if a value has already appeared in the column where unique values are being output formulaically. as i had mentioned earlier, Sheet2!A1 is either a blank cell or has a value that has no business appearing in your original data set. in that sense, COUNTIF(Sheet2!$A$1:A1,Sheet1!$A$1:$A$10) checks to see what is the count, and if it is 0, the corresponding row number is used to output the unique value.

    for further edification, you may want to consult the Evaluate Formula functionality inherently available through Formula tab's Formula Auditing group (ALT > M > V) in order the see the magic in motion.

  9. #9
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    I've tried the evaluate formula and I'm getting an error on every line which returns a '-' on the sheet. This is the formula I'm using

    =IFERROR(INDEX(NAME,MATCH(0,INDEX(COUNTIF(Rental_Summary!$A$7:A7,NAME),0),0)),"-")

    NAME is the name range and Rental_Summary is the page I want to put the unique names from the name range. I want to start in A7. Can you see if I'm doing something wrong?

  10. #10
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Unique values in a list

    if you use "Rental_Summary!$A$7:A7", you cannot start in Rental_Summary!A7; you would have to start in Rental_Summary!A8.

    see if that works, else upload a sample workbook.

  11. #11
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    Thanks again, the name range is column C in ED Rent and I'm trying to get the unique names into Rental Summary at A7. Here's the file to look at.
    Attached Files Attached Files

  12. #12
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Unique values in a list

    i am facing difficulty in looking through your file; it jams my computer up pretty bad. i am guessing it is because of the full-column named-ranges that you have in the file.

    anyway, here is the reason you are encountering error.

    i had stated that the cell on top of the first cell where you were going to enter the formula should be empty; you had a formula in that cell, which was evaluating to a blank.

    try this in your workbook - and this time, start in Rental Summary!A6 (by replacing your formula), but pay attention that Rental Summary!A5 is truly blank / empty:

    Please Login or Register  to view this content.
    typically, when i create Named Ranges, i do not include the Header Cell, nor do i use full-column ranges (A:A etc. instead of A2:A100).
    Last edited by icestationzbra; 10-16-2012 at 02:12 AM.

  13. #13
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    yes it worked. Thanks for your patience. Great forum.

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Unique values in a list

    @ myobreportguru

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  15. #15
    Forum Contributor myobreportguru's Avatar
    Join Date
    09-18-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2016
    Posts
    231

    Re: Unique values in a list

    Thanks for reminding me. I will take care of this in the future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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