+ Reply to Thread
Results 1 to 21 of 21

Data Validation: List deducts items already chosen

  1. #1
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Lightbulb Data Validation: List deducts items already chosen

    Is it possible to have a data validation that is "somewhat" dependent on what the previous data validation list has been chosen?

    Example, in Cell A1, the data validation list are as follows:
    • Apple
    • Orange
    • Lemon
    • Grapes


    If user chooses Orange in cell A1, the data validation list in cell B1 should only be:
    • Apple
    • Lemon
    • Grapes

    since "Apple" is already chosen in the previous cell, and so on...

    I attached a sample file for more visualization of my end goal...

    Thanks everyone!
    Attached Files Attached Files
    Last edited by wedzmer; 04-20-2022 at 08:34 AM. Reason: added a sample file for clearer information.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Data Validation: List deducts items already chosen

    Please try at

    Fruit B1:B5
    =INDEX($A$1:$A$5,AGGREGATE(15,6,ROW(A$1:A$5)/ISNA(MATCH($A$1:$A$5,OFFSET(INDIRECT(CELL("address")),,,,-CELL("col")),)),ROWS(B$1:B1)))

    Customer DV list at B2:D6
    =OFFSET(Fruits!$B$1,,,COUNTIFS(Fruits!$B$1:$B$5,"*"))
    Attached Files Attached Files

  3. #3
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    thanks for the response...

    the problem with this is that on the 2nd customer, the chosen items on the first customer are also taken out. the data validation should only work on the said customer's 2nd and 3rd choice and so on... it shouldn't affect the other customers options.

    i also tried adding up more items in the list which doesn't work with the formula anymore..
    Last edited by wedzmer; 04-16-2022 at 02:34 PM.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Data Validation: List deducts items already chosen

    Double click or press F9 before selecting new customer


    or add this code to sheet1

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    Unfortunately, my office pc is too slow, i forgot to mention that I couldn't bring my laptop to our office, and as such, i'm restricted with MS Excel 2007... I don't think VBA would be a route that's possible in my case.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Data Validation: List deducts items already chosen

    If your office computer showed a result for Bo_Ry's formula on the Fruit sheet cells B1:B5 then it is not running the 2007 version of Excel because the AGGREGATE function is not supported in versions older than 2010.
    It is important to know the correct version so that we can use the appropriate functions in our proposed formulas.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    no, i tested it here on my laptop at home. but the file would be used in the office. that's why i was hoping to make it work in an older excel version.
    that's why i really apologized for not clearing the office version out from the very start. i was focused on making the objective work and accomplish it.

    so, to be clear, i can only hope to run it on an older excel version, preferably 2007. as to why we didn't upgrade? the office can't... i mean, i work in a 3rd world country that has a very low budget on agency development.
    Last edited by AliGW; 04-19-2022 at 02:38 AM. Reason: PLEASE don't quote unnecessarily!

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Data Validation: List deducts items already chosen

    Last try

    Fruit B1:B5
    =INDEX($A$1:$A$5,SMALL(IF(ISERROR(MATCH($A$1:$A$5,OFFSET(INDIRECT(CELL("address")),,,,-CELL("col")),)),ROW(A$1:A$5)),ROWS(B$1:B1)))

    Confirm with Ctrl+Shift+Enter


    Quote Originally Posted by Bo_Ry View Post
    Double click or press F9 before selecting new customer


    or add this code to sheet1

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bo_Ry; 04-18-2022 at 09:55 AM.

  9. #9
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    really appreciate for trying man... but it still doesn't work...
    the second row will still remove the items that were already chosen in the first row. though the first row choices in the Customer sheet works.
    the array function does work when we add new items in the Fruits sheet.. it's just that when any item/fruit is chosen by the first customer, all of these choices that were chosen are also removed in the DV of the 2nd customer. the removing of items must only be for that particular customers choices in 1st, 2nd, and 3rd which is columns B, C, and D. but it must not include the DVs in the next customer and so on.
    Last edited by wedzmer; 04-18-2022 at 10:01 AM.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Data Validation: List deducts items already chosen

    Here is a method that I believe will do what you want in the 2007 version.
    1. On the Fruits sheet put the customer names in B1:G1
    2. Populate B2:G6 using: =SUMPRODUCT((Customer!$B$2:$D$6=$A2)*(Customer!$A$2:$A$6=B$1))
    3. Populate H1:L1 with the customer names
    4. Populate H2:L6 using**: =IFERROR(INDEX($A$2:$A$6,SMALL(IF(B$2:B$6=0,ROW(B$2:B$6)-ROW(B$1)),ROWS(H$2:H2))),"")
    5. Produce a named range for each customer (see the linked video starting at 14:14 for quick way to do this) https://www.youtube.com/watch?v=ws63XhhQi1o
    6. Use the following for the source of the data validation drop downs: =OFFSET(INDIRECT($A2),,,SUMPRODUCT(--(INDIRECT($A2)<>"")))
    Let us know if you have any questions.

  11. #11
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    This worked perfectly man! Thanks a lot...

    but, I just have a few clarifications...

    1. Since in step 5, i'm gonna create a name range for each customer, does that mean i'm gonna make name ranges for a list of respondents in my masterfile that's about 600+ individuals which also grows through time...?
    2. In the file you attached, you used an array function in the formulas, will it work even without the array function or is there another way to avoid it? Just out of curiousity.
    Last edited by AliGW; 04-19-2022 at 02:36 AM. Reason: PLEASE don't quote unnecessarily!

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Data Validation: List deducts items already chosen

    As to #1, producing the named ranges is the least complicated method I know of, perhaps someone else will offer a better way of doing this. The method shown in the video is the best way that I have found to produce multiple named ranges although I can see that for 600+ customers even that would be tedious.
    As to #2, I don't know of an alternative to using an array entered formula in H2:L6, using the 2007 version. Starting with the 2010 version the AGGREGATE function could be used to produce a regular formula.

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

    Re: Data Validation: List deducts items already chosen

    Just one Named Range required for this:

    I called it DV:

    NDEX(Fruits!$H$2:$L$2,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)):INDEX(INDEX(Fruits!$H:$L,,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)),SUMPRODUCT(--(LEN(INDEX(Fruits!$H$1:$L$100,,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)))>0)))

    If there are more than 100 fruits, adjust the bit in red... do not go mad, though. If you set to 10,000 and you only have 20... performance may get slow.

    I also changesd the arra formula in H2 to this (copied across and down):

    =IFERROR(INDEX($A:$A,SMALL(IF(B$2:B$100=0,ROW(B$2:B$100)),ROWS(H$2:H2)))&"","")

    Change the bits in red to cover all customers and copy down as far as needed (remembering to adjust the Named Range if you copy down > 100 rows).

    No use of the volatile INDIRECT function, either....
    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

  14. #14
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    Quote Originally Posted by Glenn Kennedy View Post
    Just one Named Range required for this:

    I called it DV:

    INDEX(Fruits!$H$2:$L$2,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)):INDEX(INDEX(Fruits!$H:$L,,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)),SUMPRODUCT(--(LEN(INDEX(Fruits!$H$1:$L$100,,MATCH(Customer!$A2,Fruits!$H$1:$L$1,0)))>0)))
    The attached file works perfectly but when I apply the DV Code above, I always get a prompt that says:

    "ALERT: The Source currently evaluates to an error. Do you want to continue?"

    I tried to paste my code in a cell and it works, but the DV just won't accept it. I believe I correctly created a name range for it and even named it as simple as my own name. Lol

    Can you somehow guess what's possibly wrong with it?

  15. #15
    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,036

    Re: Data Validation: List deducts items already chosen

    Paste the formula that you used... and the name of the sheets in your real data that correspond to Fruits and Customer. That aside, it's almost impossible to tell what you've done wrong... without seeing what you've done.

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

    Re: Data Validation: List deducts items already chosen

    I just noticed that the DV formula in the THREAD has lost the

    =I

    at the beginning of it... That needs to be there to get it to evaluate as a formula. It'll be OK in my file, of course.
    Last edited by Glenn Kennedy; 04-19-2022 at 03:40 PM.

  17. #17
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    Quote Originally Posted by Glenn Kennedy View Post
    Paste the formula that you used... and the name of the sheets in your real data that correspond to Fruits and Customer. That aside, it's almost impossible to tell what you've done wrong... without seeing what you've done.
    I think I've tried to redo it a hundred times already.. lol

    this is what I used in my DV call-out:

    Please Login or Register  to view this content.
    based on the code you used:

    Please Login or Register  to view this content.
    I just can't get it to work... if you'd be so much kind enough to look at the masterfile where I used the aforementioned principle, please do...

    The Customers Sheet is the INPUT_SHEET for the school and the Fruits Sheet is the iSF_Checker and iSF_Checker2 respectively... I tried to separate the "fruits sheet" contents into different sheets in order to see where I could possibly correct some errors if there's anything wrong with it...

    The last problem I only encounter is the DV call-out.

    PS
    I can't attach it here anymore, the file tend to be larger than I thought... so, I uploaded here on my google drive... ---> Masterfile
    Last edited by wedzmer; 04-19-2022 at 04:07 PM.

  18. #18
    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,036

    Re: Data Validation: List deducts items already chosen

    I have it running... the refs to B2 had changed to B104768... but it is impossibly slow. For ease of checking I renamed the isfchecker as sheet a. leave it that way for now. The DV is applied oNLY to the dark pink cells. Check it... but for now BE AWARE that it takes several SECONDS to recalculate. I'm off now and will check in again in the morning.

    You can save as xlsb ande zip. Did you want this for Googlesheets or Excel. If for GS, I'll stand aside NOW, as I have no idea what GS can and can not do.
    Attached Files Attached Files

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

    Re: Data Validation: List deducts items already chosen

    It's faster... but still unusable, in my opinion. 1000 teachers is just crippling the sheet.

    DV only appplied to the dark pink cells.
    Attached Files Attached Files

  20. #20
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Data Validation: List deducts items already chosen

    Quote Originally Posted by Glenn Kennedy View Post
    It's faster... but still unusable, in my opinion. 1000 teachers is just crippling the sheet.

    DV only appplied to the dark pink cells.
    thanks for all of these man, i really really appreciate it!
    and yeah, you're definitely right... it takes a lot of time to load between each DV Cells... I tried the file awhile ago at the office before we lost our internet connection and Excel 2007 almost died. lol
    I guess.... I should take this project to rest now... It's not efficient anymore.

  21. #21
    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,036

    Re: Data Validation: List deducts items already chosen

    I agree.

    Unless you can use VBA... you're out of luck. back to the planning phase for you....


    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. [SOLVED] Number items in a list that are NOT chosen
    By mozartk626 in forum Excel General
    Replies: 4
    Last Post: 05-26-2020, 07:47 AM
  2. [SOLVED] List unused items from data validation list without blanks
    By L plates in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-27-2015, 09:02 AM
  3. [SOLVED] Identify value chosen from validation list using VBA
    By kadeo in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-13-2014, 12:40 PM
  4. Data Validation - How to allow only the items not in a list..
    By balu.soln4biz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2014, 05:35 PM
  5. Data Validation: items in one list relate to items in another
    By Paul D. Simon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 05:05 PM
  6. Replies: 1
    Last Post: 06-24-2005, 12:21 AM
  7. Data Validation - Also allow items not in list
    By CyberSOG in forum Excel General
    Replies: 7
    Last Post: 03-16-2005, 02:06 PM

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