+ Reply to Thread
Results 1 to 6 of 6

Data Validation to pre-populate answer in the next column or return a drop-down

  1. #1
    Registered User
    Join Date
    10-10-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    4

    Data Validation to pre-populate answer in the next column or return a drop-down

    Hi Everyone,

    I am trying to create a template where I have a data validation drop-down in column G with a question "Is this a New Vendor? (Y/N)" and a drop-down selection of "Yes" and "No". The next column (Column H) is called "Service Start Month". I would like to add a formula to column H which will depend on the drop-down selection in column G. If someone selects answer "No" in column G, I would like column H to display "FEB" as a result. If someone selects "Yes" in column G, I would like column H to show a drop-down with all 12 months for a person to select one. As of now, I've used an "INDIRECT" function in data validation, so whenever someone selects "No" they are only able to select "FEB" in column H. But, I don't know how to make it to automatically pre-populate so that they didn't have to select "FEB" if they answered "No" in prior column.

    I had a feeling that this could have been accomplished by combining VLOOKUP and Data Validation in one cell, but cannot figure out how to achieve it. Also, I think I saw in some other threads that this could be done via macro. If so - is it possible to set this macro to be run automatically whenever someone else is filling this out? It will be used by multiple users. Thanks!

    Capture.PNG

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data Validation to pre-populate answer in the next column or return a drop-down

    The trick is to put a FORMULA in H2 before you add the data validation.

    =IF(G2="No", "FEB", "")

    Let's assume your months are listed somewhere in the workbook in 12 cells you've given a "name" in the Name Wizard as MonthList.

    After that formula is in place, add your data validation like so:

    =IF(G2="Yes", MonthList)

    No messy Indirect need.

    So now the drop down in column H won't exist at all unless column G says 'Yes", and if it says "No", then "FEB" will appear as a result of the formula.

    NOTE: If someone uses the drop down in H2 to select a month, then the formula in that cell is removed, certainly, so changing G to "No" won't fix that. That's a training issue.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation to pre-populate answer in the next column or return a drop-down

    I think you can do this with one formula inside DataValidation:

    Define NAME NO =$AA$1 where will be Feb
    Define NAME YES =$AB$1:$AB$12 where will be list of months
    G2: (DV-List) directly Yes,No
    H2: (DV-List) =IF(G2="no",NO,YES)

    edit:
    ups, I forgot about pre-populate Feb, sorry
    Last edited by sandy666; 10-10-2015 at 09:37 PM.

  4. #4
    Registered User
    Join Date
    10-10-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    4

    Re: Data Validation to pre-populate answer in the next column or return a drop-down

    Thank you so much for such a quick response!! This is exactly what i was looking for

  5. #5
    Registered User
    Join Date
    10-10-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    4

    Re: Data Validation to pre-populate answer in the next column or return a drop-down

    Thank you!
    Last edited by svetauruss; 10-10-2015 at 09:47 PM.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Data Validation to pre-populate answer in the next column or return a drop-down

    [ ...deleted... ]

    If Target.Column = "G2" Then

    should be

    If Target.Column = 7 Then
    Last edited by sandy666; 10-10-2015 at 11:13 PM. Reason: code changed

+ 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. Drop Down, Single Answer, Auto Populate
    By simple? in forum Excel General
    Replies: 4
    Last Post: 10-11-2015, 05:26 AM
  2. Populate cell data based on data validation (drop down list)
    By ish_baho in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-05-2014, 11:47 PM
  3. Replies: 2
    Last Post: 08-13-2013, 05:27 PM
  4. Look-up column via drop-down box then populate userform with row data
    By cameronyoung in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 12:54 PM
  5. Replies: 4
    Last Post: 04-11-2013, 12:18 PM
  6. Data Validation-Auto populate from a drop down menu
    By Shannonm2706 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-23-2013, 11:00 AM
  7. [SOLVED] How to reference/populate a column of data based on a drop down menu selection
    By walterst in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2012, 07:11 PM
  8. Return Value Next To Column With Data Validation
    By Nick101 in forum Excel General
    Replies: 13
    Last Post: 04-20-2011, 01:33 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