+ Reply to Thread
Results 1 to 19 of 19

Hiding duplicates from drop down lists

  1. #1
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Hiding duplicates from drop down lists

    Hello,

    I have made an inventory list where I select my items from drop down list where I have stored all my items. If I do a selection and add an item to my inventory list, I want that item do dissapear from the selection of the drop down list. How can I do it?

  2. #2
    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,053

    Re: Hiding duplicates from drop down lists

    Is this what you had in mind? Happy to explain it if it is. There is no point in doing so until I really understand what you want!!
    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

  3. #3
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Hiding duplicates from drop down lists

    Glenn beat me to this (I went to lunch before posting!). My solution is very similar to his, except that I use two Named Ranges - one for the items already chosen and one for the unchosen items - and a different formula to achieve the same results. As he says above, if this is roughly what you want, then we can explain the details.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  4. #4
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Quote Originally Posted by Glenn Kennedy View Post
    Is this what you had in mind? Happy to explain it if it is. There is no point in doing so until I really understand what you want!!
    Thank you, yes it is what I need but I still can't get my problem fixed, because I have dependant drop down lists where first I select a category then by that category I get the item values on the cell next to it, and I need that item list to not show duplicated values, just after I pick one it dissapears from the list. I made a few screenshots to make it more clear. Untitled.png1.png

  5. #5
    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,053

    Re: Hiding duplicates from drop down lists

    Screenshots are useless.

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  6. #6
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Glenn Kennedy,

    Yes I will send you a shortened version of my list. My full list range is in the 1000 mark. For inserting items to my list at first you need to select a group in which items are stored, then you get their inventory numbers. I need that inventory numbers to not get duplicated. I narrowed this file to have only 2 item groups: "Motorinė" and "Elektriniai". In Ctrl+F3 you will see the same names as these two groups.
    Attached Files Attached Files
    Last edited by jeffreybrown; 12-20-2018 at 10:25 AM. Reason: Removed unnecessary full quote!

  7. #7
    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,053

    Re: Hiding duplicates from drop down lists

    The key to whether or not this is do-able is the number of possible item Groups. Currently you are showing 2 (motorine and Elektrikinai). Each item group will generate two additional columns. So if you have a small number of these, it's easy. If you have many, it becomes VERY tedious... or impossible. So how many item groups are there?

  8. #8
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    I have 9 groups in total.
    Last edited by AliGW; 01-08-2019 at 06:54 AM.

  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,053

    Re: Hiding duplicates from drop down lists

    That's do-able, but it will take you about 30 mins to set it up. I sweated blood over this. It was easy enough to do what you wanted, but making the named ranges dynamic... so that all those empty rows DO NOT show up on your dropdowns took a little (!!) time.

    1. Insert new rows - now F&G for Motorine and L&M for Eleektikinai. make sure that G and M and others are labelled Motorine, etc...

    2. In F3, copied down:
    =IF(D3="","",COUNTIF('item List'!$E$5:$E$130,Inventory!D3))
    You will see from this, that I have allowed the item list column E to go down to row 130. Adjust if needed. This identifies those values that have already been selected in Item List Column E.

    3. In G3, copied down:
    =IFERROR(INDEX(D:D,AGGREGATE(15,6,ROW(D$3:D$220)/(F$3:F$220=0),ROWS(G$3:G3))),"")
    You will see from this, that I have allowed the Inventory column D to go down to row 220. Adjust if needed. This returns ONLY those items that have NOT already been used in Item List column E.

    4. Clear the data validation from Inventory E5 to E130.

    5. Set a Named Range (DD_Range) using this formula:
    =OFFSET(INDEX(Inventory!$C$3:$M$3,,MATCH('Item List'!$D4,Inventory!$C$2:$M$2,0)),,,SUMPRODUCT(--(LEN(INDEX(Inventory!$C$3:$M$3,,MATCH('Item List'!$D4,Inventory!$C$2:$M$2,0)):INDEX(Inventory!$C$3:$M$220,218,MATCH('Item List'!$D4,Inventory!$C$2:$M$2,0)))>0)))

    This was the one that took some time to get right!! Basically it identifies the range in Inventory, rows 5:220, that correspond to the value present in the corresponding row in column D of Item List (currently either Motorkine or Elektrakini). It then returns ONLY that part of the range that contains non-blank cells. In your previous DD lists, not only could you select duplicates, but there were dozens of blank rows. This formula is fully dynamic. The 218 in red corresponds to the maximum possible number of items in each list (starting from row 3 and ending in 220). If you cut the range back from 220, you will need to adjust this, too.

    6. Set data validation in E5:E130 of Item List, using this:
    Allow: List
    Source: =DD_Range

    7. To extend, simply copy/paste F2:G3 of inventory into the corresponding positions for the remaining Item groups.

    I hope that this is what you want. I think that I haven't seen this approach working previously without VBA... which I know nothing about.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 12-22-2018 at 02:04 PM.

  10. #10
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    It looks good with your workbook, but unfortunately i can't gat it right on mine, I just do everything you instructed me and i get that DD_Range source evaluates to an error, I even copied all of my inventory list rows and then pasted on the workbook that you made, changed the DD_Range formula range from C2:M2 to C2:AW2 (thats my full inventory range) and it still doesn't work...
    Last edited by jeffreybrown; 12-27-2018 at 10:23 AM. Reason: Removed unnecessary full quote!

  11. #11
    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,053

    Re: Hiding duplicates from drop down lists

    Unless I see your sheet, I cannot tell what's wrong.

  12. #12
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Here's my sheet.
    Attached Files Attached Files
    Last edited by AliGW; 01-08-2019 at 06:53 AM.

  13. #13
    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,053

    Re: Hiding duplicates from drop down lists

    It was not working for Motorine becasue Inventory G2 did not have the accent on the final E. Fixed.

    The same problem for Zenklai and Savaeige Both fixed.

    It is (still) not working for Nuomuojami, as it is not included in the range out to AC2!!
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Nuomuojami doesn't need that formula it can have duplicates. May I ask you maybe you sent me a wrong file???? because this one let's inventory items be duplicated..error ss.png
    Last edited by AliGW; 01-08-2019 at 06:53 AM.

  15. #15
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Oh it works for some but for other groups it doesn't, where's the problem?

  16. #16
    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,053

    Re: Hiding duplicates from drop down lists

    In the Used column in Inventory, most of the formulae in row 3 were pointing to the code number in row 5. They are now all pointing to row 3 and it works. You will need to add Nuomuojami to the range, too. However, don't use the same formulae. Just copy/paste the values from the inventory number column into the light pink colum and make sure the spelling of Nuomuojami is correct.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    06-26-2018
    Location
    Lithuania
    MS-Off Ver
    2016
    Posts
    60

    Re: Hiding duplicates from drop down lists

    Everything works fine now. Thank you Glenn for helping solve this problem!
    Last edited by AliGW; 01-08-2019 at 06:53 AM.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Hiding duplicates from drop down lists

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  19. #19
    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,053

    Re: Hiding duplicates from drop down lists

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Compare lists of URLs for duplicates, and remove duplicates
    By mrfranklin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2021, 02:54 AM
  2. Replies: 2
    Last Post: 12-27-2013, 09:24 AM
  3. [SOLVED] Filter - Hiding duplicates but displaying 1 of the duplicates item
    By blacky1 in forum Excel General
    Replies: 3
    Last Post: 04-19-2012, 07:43 AM
  4. [SOLVED] Hiding duplicates but displaying 1 of the duplicates item
    By blacky1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2012, 07:39 AM
  5. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-30-2011, 09:24 AM
  6. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2011, 06:49 AM
  7. drop down lists referencing tables creating other drop down lists!!
    By Stumped- in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-07-2009, 11:29 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