+ Reply to Thread
Results 1 to 2 of 2

Data Validation: help creating error message based on certain conditions

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Data Validation: help creating error message based on certain conditions

    I am working on a sheet in which users will respond to 9 questions, 7 of which are "Yes/No" and 2 are numerical answers. For the response cells, which occur in D8 thru D16, I have used Data Validation to restrict answers, which then result in a point being awarded or not being awarded in columns E-G.

    If the answer to question 1, recorded in D8, is "Yes," then the answer for question 2 can be either "Yes" or "No" - and is input in D9. By the way, I have used =COUNTIF(D9, "Yes") in G9 and =COUNTIF(D9, "Yes")*2 in G8 to score the response (the times 2 because that question is weighted and a yes response is worth 2 points).

    My problem is, under the rules of the questionnaire, if D8 is no then D9 must also be no (the first two questions may be answered yes/yes, yes/no, or no/no, but not no/yes). I would like an error message to appear if the user attempts to answer no/yes, but can't seem to get it. I'm trying to not use VBA because I know very, very little about that - but I could go that route with easy, step-by-step directions.

    For now, my work around was simply creating =IF(AND(G8=0,G9=1),"Error"," ") in H9 to alert the user of an error, but this does not prevent them from continuing anyways.
    Last edited by HeyInKy; 04-14-2013 at 01:40 PM.

  2. #2
    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 creating error message based on certain conditions

    What you could do is link the validation in cells G10 onwards to the result of the formula in cell H9.

    If H9 = ERROR don't allow any entries in cells G10 onwards.

    Something like:

    =AND(H$9<>"ERROR",OR(G10="Yes",G10="No"))

    =AND(H$9<>"ERROR",OR(G10=some_number>=this,G10=some_number<=this))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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