+ Reply to Thread
Results 1 to 4 of 4

Multiple data validations based on user input?

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    DFW, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Multiple data validations based on user input?

    Hello! I have a workbook that multiple users enter data into every day (we create a new one each month). The volume is quite large; by the end of the month there are easily over ten thousand entries.

    I need the users to stop entering inaccurate data. I'm not sure how to achieve what I'm looking for. Basically I need four special columns, G:J.

    Column G was easy enough. I set Data Validation to a list of USA States taken from a reference sheet in the workbook.

    I want column H to have a dropdown menu that then shows the corresponding form names associated with the State the user chose in column G ( i.e. user chooses CO, so I want only CO forms to be listed in the dropdown menu). This data is pulled from the reference sheet.

    I want column I to not be a user-entry field. I want it to auto-populate with the ID number given to each form in the reference sheet based on what the user put in columns G and H. There are hundreds of different forms and corresponding IDs.

    I want column J to be more or less like column I; one with automatically filled cells based on G and H. This will be a one or two word description of the form's purpose, also pulled from my reference sheet. There are only 4 or 5 different descriptions.

    All help is appreciated; I'm not sure where to start. Thank you in advance!

  2. #2
    Registered User
    Join Date
    06-21-2013
    Location
    Wiltshire, UK
    MS-Off Ver
    365 Version 2210 Build 16.0.15726.20070
    Posts
    72

    Re: Multiple data validations based on user input?

    Are you able to execute macros? With VBA it is a piece of cake. Without VBA it is possible but takes a fair bit of preparation. Which route do you want to use?

    G and H are:-
    With VBA you use the worksheet_Change event to intercept cell change and either redefine the data validation for the cell on that row OR provide custom dropdowns via forms.

    NON VBA requires the use of tables and named ranges. Have a look at the attachment. There is also an excellent explanation by Jeff Lenning Non VBA conditional data validation drop down lists

    I and J are:
    lookup() formulae to a table of form names, their IDs and Descriptions
    Attached Files Attached Files
    Last edited by isskint; 08-13-2014 at 04:55 PM. Reason: Missed something
    Isskint, i get satisfaction out of helping others

  3. #3
    Registered User
    Join Date
    08-13-2014
    Location
    DFW, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Multiple data validations based on user input?

    This looks great! You make it look so easy. I've taken it and put in the actual form names and information.

    I have run into two problems, however.

    Columns I:J occasionally return a "#N/A" error. From what I can see, it's only on Form names that start with a number or special character. This may be purely speculation though, since I only put in about 15 test entries. Aside from that, some of the IDs are wrong, as in the same ID is showing up for multiple forms, and some of them are just wrong altogether.

    Column J now isn't always giving me consistently accurate information. Brief example: CA Form 1's description in the Forms Data table is "dmv form", but on the Input Sheet, Column J's description for that entry reads "title". My best guess for why this is happening is because some state form names are the same, and the only way to tell the difference is by specifying the state (or by going off of the ID number, which is different for every form no matter the state). Is there a way to have the LOOKUP function look for G2 (state) and H2 (form name) in the Forms Data table to return the proper result?

    I tried changing "=LOOKUP(H2,tblFormData[Form],tblFormData[ID]" to "=LOOKUP(G2:H2,tblFormData[Form],tblFormData[ID]" and got a "#VALUE!" error. What am I doing wrong?

    Thank you so much for your help, isskint!

  4. #4
    Registered User
    Join Date
    06-21-2013
    Location
    Wiltshire, UK
    MS-Off Ver
    365 Version 2210 Build 16.0.15726.20070
    Posts
    72

    Re: Multiple data validations based on user input?

    The answer to this would be, I think, an array formula. There are a couple of ways to approach it but i would suggest;
    Please Login or Register  to view this content.
    The MATCH() will identify the row where both conditions are met. This returns a value of 1, which is matched to the 1 that is used as the lookup value of the MATCH function and so returning the row where the conditions are met. INDEX will then return the Description from that row. (Confused? Often I am too, but array formula are well worth investing the time and effort to understand!)

    Paste the formula, click on it in the formula bar (as if to edit), then press CTRL+SHIFT+ENTER. When you enter an array formula you MUST press CTRL+SHIFT+ENTER or it will not work.

    NB
    As for the issues in I:J, the form names need to be sorted A-Z (i forgot that in my example )
    Last edited by isskint; 08-15-2014 at 05:43 PM.

  5. #5
    Registered User
    Join Date
    08-13-2014
    Location
    DFW, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Multiple data validations based on user input?

    I've had brief experience with array formulas, so I'm no expert....but I did try putting that formula you mentioned into column J, both as a normal and array formula, neither worked. I got an error message:

    "The formula you typed contains an error.
    • For information about fixing common formula problems, click Help.
    • To get assistance in entering a function, click Function Wizard (Formulas tab, Function Library group).
    • If you are not trying to enter a formula, avoid using an equal sign (=) or minus sign (-), or precede it with a single quotation mark (')."

    then highlighted "tblInput[@Form]"....Not sure what's going on with all that.

+ 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. Auto filter based on user input with multiple choices
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2014, 04:23 PM
  2. VBA to Select Multiple Weeks in Pivot Table based on User Input
    By burrow.philip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2014, 11:36 AM
  3. Data Input Form with number of line items based on user input
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 02:54 PM
  4. Returning Values based on multiple user input
    By ahelman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-20-2012, 01:24 PM
  5. Extracting Data based on user input
    By gr8cobbler in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-29-2010, 10:32 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