+ Reply to Thread
Results 1 to 9 of 9

Data validation based on value from another column

  1. #1
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Data validation based on value from another column

    We are building out a template, one column will contain a list of acceptable values to chose from.. And the column next to it needs to be provided if a specific value is chosen from the dropdown.

    At this point, we are in the design/discussion phase, so dont have anything to upload, as we are just looking to see if its possible to handle that kind of validation.

    Brief example:

    Column A Column B
    Planned Not required
    Unplanned Required

    So basically the dropdown list that is provided to the user in column a contains planned and unplanned
    If they chose Planned, they can move on and complete the rest of the row..
    If they chose Unplanned, then they need to provide something in column B

    Is this possible with data validation? Or will that require some custom vba checks or not possible at all?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data validation based on value from another column

    It depends on what "the rest of the row" means. The data validation would not be in column A or B, it would be in the "rest of the row". There would be a rule that says

    =OR($A1="Planned",AND($A1="Unplanned",$B1<>""))

    This would require that before the rest of the row can be filled in, either A must be Planned, or if it's Unplanned then B must have a value.

    That is how you would do it with data validation. However, you may have other data validation requirements for those cells that get in the way.

    Depending on the complexity of all of the validation you want to do, VBA would also be an option. It's not possible to say much more based on what you have described so far.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Data validation based on value from another column

    so for simplicity, i said Column A and Column B...in reality it will probably be more like Column G and H not that it matters.. But the only validation needed is that if the user choses a certain value from dropdown(Unplanned) then the cell next to it needs to contain some text, the rest of the row has nothing to do with this validation.. meaning there is always going to be a chance that the cells within a row are not all filled in.. this is a status report we will be building and today i can have certain things done and can provide certain information.. but maybe a few days before i have more data to provide/update.. BUT once i get to that column/cell if i chose Unplanned, then i need to provide a explanation/notes why..

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data validation based on value from another column

    I don't understand what point you are making in your last post. The rest of the row has everything to do with this validation. The way to do the validation you described is not to put the data validation in G or H, but to put it in the rest of the row to prevent entries there if you have not made the required entries in G and H first. However, that will be problematic if there is other validation that needs to be done in the rest of the row.

  5. #5
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Data validation based on value from another column

    sorry, maybe I'm not understanding how the data validation works within excel. Once we have a sheet created i can upload, but we are not looking to prevent anyone from entering a row because they haven't provided column g..
    This report will be completed/updated daily, weekly monthly, it all depends on that teams schedule.. and today they may have enough information to say fill in columns A thru D, later today or tomorrow they may be able to update/fill in column E and it may be next week or later that they can fill in columns F thru M

    All we want that once someone has made a selection(other than the default "blank"), if they select "Unplanned" then the column next to it (column H cell in this example) becomes required. And if blank or 'Planned" then that cell is not required.

    If this was a form or web page that collected critical data, i can understand that you want to capture it before submitting, but this is nothing more than a list of tasks that each team is working on and not critical that those cells are provided before saving the data..

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data validation based on value from another column

    So what do you mean by "required"? At what point in the process of completing the information do you want to make sure something has been entered in H if they select "Unplanned"?

  7. #7
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Data validation based on value from another column

    anytime that the selected value in G is "Unplanned" then it should require them to provide H.
    If i were the one that was filling in for my team, i could enter a row with some information just so its captured and not forgotten.. and then come back at a later time to provide more or complete the whole row..
    This worksheet is very informal and more for supervisors to gauge what items are being worked on.. because all the formal data is captured in other systems, this is a way to get idea of what is going on across all areas without having to literally go into all systems or areas to get an update.. so this is very high level statuses.

    we should have some idea of how this template will look this week, so once we do, i can upload a sample file..

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data validation based on value from another column

    I will try one more time. You are providing contradictory requirements.
    anytime that the selected value in G is "Unplanned" then it should require them to provide H.
    Ok, so if it's required, then they aren't allowed to enter any other data until they provide it.
    If i were the one that was filling in for my team, i could enter a row with some information just so its captured and not forgotten.. and then come back at a later time to provide more or complete the whole row..
    Oh, so it's not really required, because you are allowed to skip it and enter other data.

    Ignoring the contradiction, here are the two ways that are best practices for the type of validation you seem to be describing.

    Scenario 1: The typical way this is done in a user interface is if you enter Unplanned, then you should not be allowed to make any other entries until you make the entry for H. There are two ways to do this:

    1. Use data validation in all of the cells in the row so that they will all reject input until the user has provided a value in H. That is the data validation rule I provided in post #2.
    2. Use VBA to prevent the user from selecting any other cell until they have provided a value in H

    Scenario 2: The alternative is when you have a form of data that must be submitted, and when you hit the Submit button, you check to see if the required data has been provided. If not you reject the Submit and put the user in the field where the data is missing. But that is not the situation you are describing; the user is entering data in worksheet rows, not a form. There appears to be no "submit" for a row, so you have to use the first scenario I described above.

  9. #9
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Data validation based on value from another column

    Ill try and put together a sample file based on what is already known within our team and go from there, i agree, its not technically required before moving on, and maybe "validation" was not the correct title to use.
    at the end of the day all we care about is that if you chose "unplanned" you provide notes/comments explaining why.. thats all..

    may end up doing the vba method,
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

+ 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: 7
    Last Post: 01-18-2019, 04:25 PM
  2. data validation based on the value in colum - same column
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-15-2019, 06:22 PM
  3. [SOLVED] Data Validation based on column value
    By Tetnus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-11-2018, 09:18 PM
  4. [SOLVED] Data Validation List: Column A based on Value in Column B
    By GuruWannaB in forum Excel General
    Replies: 3
    Last Post: 05-01-2018, 11:50 PM
  5. Repeating Formula based on data validation within same column
    By Rosadocc in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-04-2018, 05:34 AM
  6. Creating validation list from table column based on data in another column
    By dreamthrum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-11-2013, 08:38 PM
  7. [SOLVED] Hide column based on data validation
    By shahbaz01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2012, 06:33 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