+ Reply to Thread
Results 1 to 12 of 12

data validation question

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2007
    Posts
    16
    NBVC, you're my Excel hero! Thank you again! Two last questions...well until I think of the next one.

    First, if a person enters "yes" in cell C1 (which will allow input in D1), can I make D1 a drop down box as well, or am i only allowed 1 data validation per cell. It would be very helpful if I could make C1 a dropdown "yes or no" and then let D1 be a dropdown box be "strawberry, rocky road, other" (i don't want them to be able to put in Mint)...see what I mean?

    Second, the spreadsheet I'm creating will have varied data from month to month (I'm making a spreadsheet to track if cancer patients go on a clinical trial or not). The number of patients the office sees varies from month to month. What'd I'd like is the totals to be on the last line on the sheet and what I'd like to avoid is 'X' amount of blank lines before getting to the totals. For instance:

    In January we saw 50 patients and 15 of them went on a clinical trial. So, I can use your handy formula on lines 51 and 52. If in Feb the office sees 30 patients, I'd rather not have 20 blank lines before it gets to the totals. March we saw 65 patients, I'd rather not reformat that spreadsheet from month to month.

    Does what I'm asking make sense? Is it possible?
    Last edited by sous2817; 05-31-2007 at 10:34 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Without getting into some VBA macros to find the last row and insert formula, you can't do that too easily.

    My suggestion would be to insert a row at the top of the sheet and place the formulas there that will summarize your data.


    My previous formula(s) could be ammended to consider entire columns,

    e.g. =COUNTIF($C:$C,"yes")/COUNTA($C:$C)

    will count all yeses in column C and divided by number of cells containing any values in column C.... you would just subtract, from the divisor, the number of rows at top that contain headings, etc. so that you only account for the rows containing yes or no entries.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-31-2007
    Posts
    16
    Thanks again NBVC, that makes sense. Just keep all the formulas in the top of the sheet...I should have thought of that...I was busy editing my previous post adding another question. I'm not sure if you saw it, so I'll repost it here:

    if a person enters "yes" in cell C1 (which will allow input in D1), can I make D1 a drop down box as well, or am i only allowed 1 data validation per cell. It would be very helpful if I could make C1 a dropdown "yes or no" and then let D1 be a dropdown box be "strawberry, rocky road, other" (i don't want them to be able to put in Mint)...see what I mean?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    yes, you can do that


    First create the list somewhere in the spreadsheet in a single column.

    Then select that list and go to Insert|Name|Define and in the field at the top (names in workbood) enter the word "yes" (without quotes). Click OK

    Now select any blank cell (that won't ever be used) and repeat the naming process above calling that cell "no"....again no quotes.

    Now select D1 (cell next to your yes/no dropdown) and go to Data|Validation and select List. In the source field enter formula: =INDIRECT(C1) and click Ok.

    Now, when user selects yes in C1, he gets a list of flavours in D1. If he selects no in C1, he gets a blank list.

  5. #5
    Registered User
    Join Date
    05-31-2007
    Posts
    16
    Oh wow! This is the coolest spreadsheet I've ever made...I can't thank you enough for all your help! I better hit the hay...I've got a lot of formatting to do tomorrow. I'm sure I'll be back w/ a few more questions, I hope you won't mind me picking your brain again...

    Kind regards,

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    No problem.

    Good Night and Good luck.

+ 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