+ Reply to Thread
Results 1 to 8 of 8

Combine and show two list in data validation with if condition

  1. #1
    Registered User
    Join Date
    02-24-2020
    Location
    India
    MS-Off Ver
    2010
    Posts
    23

    Combine and show two list in data validation with if condition

    HI,
    1. I have a list of "products", "raw materials", "packing materials" each in different sheets
    2. and in another i have data validation to show this list with respective to the value in near by cell as "SALE", "PRODUCTS","MANUFACTURING", "PURCHASE"

    Now,

    1. if the cell has value "SALE" or "PRODUCTS" I want to get the list of "PRODUCTS"
    2. If the cell has value "Purchase" or "Manufacturing" i want to show both list "RAW MATERIAL" AND "PACKING MATERIAL"

    I found a VBA code mentioned below to do this ,

    Please Login or Register  to view this content.
    Now..how do i write formula in data validation for this to work.
    Last edited by arunvijilan; 03-02-2020 at 04:14 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,643

    Re: Combine and show two list in data validation with if condition

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,643

    Re: Combine and show two list in data validation with if condition

    Please note that writing in uppercase is considered shouting. As we are all friends here, please refrain from doing that. Thank you

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Combine and show two list in data validation with if condition

    Lots of links search for excel dependent validation list
    https://www.excel-easy.com/examples/...own-lists.html
    https://trumpexcel.com/dependent-dro...list-in-excel/
    https://www.contextures.com/xlDataVal02.html

    if you wish to combine 2 lists the easiest is to jut paste the as a continuous range
    Otherwise they can be linked by formulas to look up the ranges
    or vba to create a joined range


    building on the links
    a combined list for packing materials and raw material
    =IFERROR(IF(ROW(A1)<=COUNTA(Packing),INDEX(packing,ROW(A1)),INDEX(Raw,ROW(A1)-COUNTA(packing))),"")


    If you have defined the ranges as packing and raw respectively
    Last edited by davsth; 03-02-2020 at 04:40 AM.

  5. #5
    Registered User
    Join Date
    02-24-2020
    Location
    India
    MS-Off Ver
    2010
    Posts
    23

    Re: Combine and show two list in data validation with if condition

    Thanks for your reply,
    Please note, my problem in little complex than dependent validation list

    as per examples is the links provided

    if it is fruits = fruit list will appear
    if it is vegetable = vegetable list will appear.

    But if i want both the list of fruits and list of vegetable appear as single list.

    then, how do i do it ?

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Combine and show two list in data validation with if condition

    see my formula at the bottom
    you create a physical range in the spreadsheet that combines both ranges, name it say both, and then link to it as per the articles
    =IFERROR(IF(ROW(A1)<=COUNTA(Packing),INDEX(packing,ROW(A1)),INDEX(Raw,ROW(A1)-COUNTA(packing))),"")
    counta(packing) is the number of items in packing so it pulls all of the items in packing into a column, then when it has run out takes the items from raw

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Combine and show two list in data validation with if condition

    Something like the below


    I am sure you can adapt, if you had given an example, people could have looked at you specific problem


    The green drop down chooses the category


    the ranges on the other sheet, populate the yellow dropdown, with fruitveg being a combination of both of them
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-24-2020
    Location
    India
    MS-Off Ver
    2010
    Posts
    23

    Re: Combine and show two list in data validation with if condition

    I understand this concept.it does works.

    Just it case if i want do without create a new range...is there a way

    Thank you very much.
    Last edited by arunvijilan; 03-02-2020 at 06:12 AM.

+ 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] Data validation list with date condition
    By benlw1984 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-02-2020, 03:39 PM
  2. Combine two data validation functions - 'List' & 'Custom'
    By STUARTXL in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2018, 08:52 AM
  3. Always Show drop down list Of Data Validation List
    By dorothyredsh0es in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-26-2018, 12:40 AM
  4. Data Validation combine 2 dynamic list with an IF statement
    By jwan544 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-14-2018, 04:24 PM
  5. [SOLVED] Combine two data validation list and formula in the same cell?
    By Hellion in forum Excel General
    Replies: 1
    Last Post: 08-09-2016, 01:49 PM
  6. [SOLVED] Combine Data Validation list, vlookup and Omit Characters
    By Hilkiah in forum Excel General
    Replies: 7
    Last Post: 08-31-2015, 11:28 AM
  7. Data Validation list with condition
    By vascobmcastro in forum Excel General
    Replies: 21
    Last Post: 08-16-2010, 12:18 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