+ Reply to Thread
Results 1 to 27 of 27

Data validation help please

  1. #1
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Data validation help please

    Hi guys,

    I have this issue and I really need an expert help.

    I have this table

    Data_Validation.jpg

    C15 is a dropdown list of manufacturing lines (1, 2 and 3)

    1) I need to create a dropdown list in C19 that shows all products made on a given manufacturing line based on my selection in C15 list. In other words, if I select 1 in C15, I should get in C19 a dropdown list that shows product 1, product 4 and product 7
    2) I need to create a dropdown list in C21 that shows all products made on a given manufacturing line and of type A only, based on my selection in C15 list. In other words, if I select 1 in C15, I should get in C21 a dropdown list that shows product 4 and product 7
    Attached Images Attached Images

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Data validation help please

    I am sure someone will also suggest a methodology based on named ranges. If your lines are "fixed" then this may work for you.

    Here are some alternative methodologies that use pivot tables, but they provide a more flexible solution.
    http://www.utteraccess.com/wiki/inde..._%28Non-VBA%29
    http://www.utteraccess.com/wiki/inde...ists_%28VBA%29
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    See if this what you want.

    Please note that some range I've made as a fix. Thus, if your file is going to get bigger, then you'd need to make it dynamic.

    However, for the 'Data Validation' drop down, the named range is dynamic.
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Data validation help please

    Post a small sample file that shows exactly what you have in the screencap and I'll fix it for you.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Thanks so much guys for your contribution

  6. #6
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by dluhut View Post
    See if this what you want.

    Please note that some range I've made as a fix. Thus, if your file is going to get bigger, then you'd need to make it dynamic.

    However, for the 'Data Validation' drop down, the named range is dynamic.
    dlluhut,

    Thanks so much. that's exactly what I was looking for. I just have one little problem. I am not good with pivot tables. the actual sheet I am working on has much more data than in the sample that I showed and I am not sure how to create pivot tables in the same way you did.

    Is there any other way data validation can be done without creating pivot tables!
    for example, offset formula. Something like this
    OFFSET($A$2:$C$7,,$B$9-1) for C19. What do you think?

  7. #7
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by Tony Valko View Post
    Post a small sample file that shows exactly what you have in the screencap and I'll fix it for you.
    Thanks Tony, do you want me to attach the actual file?

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Data validation help please

    Quote Originally Posted by mq1973 View Post
    Thanks Tony, do you want me to attach the actual file?
    No, not the actual file.

    I'll just make up a sample file that matches your screencap.

    What version of Excel does this have to work in? Your profile says you're using Excel 2003.

  9. #9
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by Tony Valko View Post
    No, not the actual file.

    I'll just make up a sample file that matches your screencap.

    What version of Excel does this have to work in? Your profile says you're using Excel 2020103.
    I am using Excel 2016

    So here is what the file looks like. the source table in one sheet
    Table.jpg

    The data validation is in another sheet
    Data_validation.jpg
    So basically, I have dropdown list in E12 for the manufacturing lines. The other three dropdown lists are dependent on my E12 selection
    If is select 1 in E12, I should get:
    1) dropdown list in M12 for the corresponding machine (there are total 8 lines and 8 machines)
    2) dropdown list in E16 for the products manufactured on the selected line and type API only
    3) dropdown list in M16 for the products manufactured on the selected line

    I would really appreciate your help. I could not figure this out. I attached the spreadsheet
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    Quote Originally Posted by mq1973 View Post
    dlluhut,

    Thanks so much. that's exactly what I was looking for. I just have one little problem. I am not good with pivot tables. the actual sheet I am working on has much more data than in the sample that I showed and I am not sure how to create pivot tables in the same way you did.

    Is there any other way data validation can be done without creating pivot tables!
    for example, offset formula. Something like this
    OFFSET($A$2:$C$7,,$B$9-1) for C19. What do you think?
    Hi mq1973,

    I'm not an expert, but I believe others would be able to help out.

    The reason why I'm using pivot tables is so that when your list gets bigger and bigger, you can just refresh the pivot tables and through the dynamic name range, it'll know automatically which range to take in order to get the 'list' for the data validation, which in a sense is dependent upon user's input.

  11. #11
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by dluhut View Post
    Hi mq1973,

    I'm not an expert, but I believe others would be able to help out.

    The reason why I'm using pivot tables is so that when your list gets bigger and bigger, you can just refresh the pivot tables and through the dynamic name range, it'll know automatically which range to take in order to get the 'list' for the data validation, which in a sense is dependent upon user's input.
    Thanks for your response. In this case, how would I apply pivot tables in the attached file. If you don't mind, would you please take a look at the file that I attached?

  12. #12
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    Quote Originally Posted by mq1973 View Post
    I am using Excel 2016

    So here is what the file looks like. the source table in one sheet
    Attachment 489614

    The data validation is in another sheet
    Attachment 489615
    So basically, I have dropdown list in E12 for the manufacturing lines. The other three dropdown lists are dependent on my E12 selection
    If is select 1 in E12, I should get:
    1) dropdown list in M12 for the corresponding machine (there are total 8 lines and 8 machines)
    2) dropdown list in E16 for the products manufactured on the selected line and type API only
    3) dropdown list in M16 for the products manufactured on the selected line

    I would really appreciate your help. I could not figure this out. I attached the spreadsheet
    Hi mq1973,

    Can you give an example of what E16 and M16 result would be?

    For example, I don't understand what it means by 'Previous Product-API only' and 'Next Product'.

    So far, what I can understand is that, when a user select a value form the data validation drop down list on cell E12, M12 would automatically display the result of the machine via the vlookup formula.

    But what about the result (drop down validation list) for E16 and M16?

    Thanks!

  13. #13
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Data validation help please

    My apology for this "drive by" post, but I only have a couple of minutes. The data on the product data sheet needs to organized so you can make a pivot table out of it which means removing the blank rows between the data, and unmerging the cells in column B and duplicating the line numbers. For example Cells B2:B6 should contain 1.

    I see that you have the data in separate tables. We might be able to do something with that instead if we use a naming convention for the tables such as Table_Line_1, Table_Line_2, etc.

    Got to run now. I will take a look at this later.

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Data validation help please

    Sorry, I won't download files with macros/VBA code.

  15. #15
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    I've done it for you based on your request and your file setting.

    However, I still think that it's 'cleaner' via pivot table etc. But it all comes down to personal preferences.

  16. #16
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Thanks so much dluhut. I really appreciate it. You are probably right that pivot tables are better but I am problem is that I'm not good with pivot tables.

  17. #17
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by Tony Valko View Post
    Sorry, I won't download files with macros/VBA code.
    It's ok Tony and I really thank you for trying to help out.

  18. #18
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by dflak View Post
    My apology for this "drive by" post, but I only have a couple of minutes. The data on the product data sheet needs to organized so you can make a pivot table out of it which means removing the blank rows between the data, and unmerging the cells in column B and duplicating the line numbers. For example Cells B2:B6 should contain 1.

    I see that you have the data in separate tables. We might be able to do something with that instead if we use a naming convention for the tables such as Table_Line_1, Table_Line_2, etc.

    Got to run now. I will take a look at this later.
    Thanks dflak, I would appreciate this approach as well. This seems to be easier.

  19. #19
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Data validation help please

    Here is an approach that works with renaming the tables. I renamed them Table_1, Table_2, etc. and made the column lookup [Product Name]. I demonstrated the concept on Sheet1.

    The validation uses INDIRECT: =INDIRECT("Table_"&A2&"[Product Name]") - I create the table name from which to look up from (how's that for ending the sentence with two prepositions?) from the value in column A. Column D is just there to double check my lookup.

    I noticed that in Table_3, there are some blank table rows. These also show up in the drop-down list.
    Attached Files Attached Files

  20. #20
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    Well...like I said, it's preferences, but my post earlier also gave you the solution that you want by having formula (not pivot table) with dynamic name range.

    So it should work like how you'd like it to be.

  21. #21
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Hi dluhut,

    when I select lines 6, 7 and 8 I get this. I guess this is because there is no API type for these lines

    Dropdown.jpg

  22. #22
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    I think this looks easier. So how do I add another dropdown list for API type only?
    Attachment 489782
    Last edited by mq1973; 11-17-2016 at 05:39 PM.

  23. #23
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by dflak View Post
    Here is an approach that works with renaming the tables. I renamed them Table_1, Table_2, etc. and made the column lookup [Product Name]. I demonstrated the concept on Sheet1.

    The validation uses INDIRECT: =INDIRECT("Table_"&A2&"[Product Name]") - I create the table name from which to look up from (how's that for ending the sentence with two prepositions?) from the value in column A. Column D is just there to double check my lookup.

    I noticed that in Table_3, there are some blank table rows. These also show up in the drop-down list.
    I think this looks easier. So how do I add another dropdown list for API type only?
    Attachment 489782

    Sorry. double post. I was trying to get rid of the attached image

  24. #24
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Data validation help please

    The same way. The tables are already named. Make sure that the column header in each is the word Type and then use:
    =INDIRECT("Table_"&A2&"[Type]") for the validation.

  25. #25
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    OK, this is what I am getting

    Type.jpg
    The list shows everything under the header "Type" but it should show type API only
    Last edited by mq1973; 11-17-2016 at 06:09 PM.

  26. #26
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,102

    Re: Data validation help please

    Attached is the updated where the data validation shows nothing when there's no API Type for the machine chosed.

    PS: If it's solved, remember to marked your thread as 'Solved'. You can do it via 'Thread Tools' and 'Solved' towards the top (beginning) of your thread/post

  27. #27
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    225

    Re: Data validation help please

    Quote Originally Posted by dluhut View Post
    Attached is the updated where the data validation shows nothing when there's no API Type for the machine chosed.

    PS: If it's solved, remember to marked your thread as 'Solved'. You can do it via 'Thread Tools' and 'Solved' towards the top (beginning) of your thread/post
    Thanks so much dluhut for your effort. It is greatly appreciated.
    The thread has been marked 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. Replies: 3
    Last Post: 06-04-2015, 02:27 PM
  2. Data validation depending on other data validation without named lists
    By Stormbringer in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-20-2015, 11:24 AM
  3. [SOLVED] Data Validation: How to clear/delete the content of the cell and not Data Validation List?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2015, 09:42 AM
  4. Replies: 4
    Last Post: 07-03-2014, 02:37 AM
  5. Replies: 4
    Last Post: 12-19-2013, 10:44 AM
  6. Adding Date Data Validation to cells with List Data Validation
    By biggtyme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2013, 09:47 AM
  7. Using Defined Names with Data Validation Depend and Data Validation Multi Select
    By Vinnie Chan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2012, 05:36 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