+ Reply to Thread
Results 1 to 3 of 3

How do you create a list & data validation in same cell?

  1. #1
    JLS
    Guest

    How do you create a list & data validation in same cell?

    I have a range of 7 cells in a column. I want to be able to

    a-allow only a "True" input (from a drop down list unless there is another
    way to accomplish this)

    b-if any of the other cells already contain "True", they can not duplicate
    the entry in the other cells and display an error message that says they can
    answer "True" only once in the range of cells.

  2. #2
    Debra Dalgleish
    Guest

    Re: How do you create a list & data validation in same cell?

    Select the cells where you want the validation (B3:B9 in this example)
    Choose Data Validation
    From the Allow dropdown, choose Custom
    In the Source box, type:
    =OR(AND(COUNTIF($B$3:$B$9,TRUE)=1,B3=TRUE),B3="")
    where B3 is a reference to the active cell

    On the Error Alert tab, enter the message you want to appear if an
    invalid entry is made
    Click OK

    JLS wrote:
    > I have a range of 7 cells in a column. I want to be able to
    >
    > a-allow only a "True" input (from a drop down list unless there is another
    > way to accomplish this)
    >
    > b-if any of the other cells already contain "True", they can not duplicate
    > the entry in the other cells and display an error message that says they can
    > answer "True" only once in the range of cells.



    --
    Debra Dalgleish
    Contextures
    http://www.contextures.com/tiptech.html


  3. #3
    andy62
    Guest

    RE: How do you create a list & data validation in same cell?

    I don't know of a way to PREVENT the second entry of "True" in another of the
    seven cells. As you said you can use Data Validation to allow only "True" to
    be entered. When you set this up, you want validation from a list, then in
    the window below type 'True (single quote T-r-u-e) to prevent Excel from
    treating "True" as a logical operator.

    Now, in the cell below your seventh True cell, you could put in the formula:

    =IF(COUNTA($A$2:$A$8)>1,"You may enter a value of 'True' in ony one of the
    highlighted cells above","")

    (where A2-A8 are your seven cells), which will make a message appear if the
    user enters a second "True". But it does not actually prevent them from
    doing so.

    Another way to do the error flag is to put this formula in the cell to the
    right of the first of the seven cells, then copy it down to the 7th:

    =IF(AND(COUNTA($A$2:$A$8)>1,(A2="True")),"You may enter a value of 'True' in
    ony one of the highlighted cells above","")

    Using this, each of the cells with "True" get flagged, until the user
    complies by deleting any extra entries.

    HTH


    "JLS" wrote:

    > I have a range of 7 cells in a column. I want to be able to
    >
    > a-allow only a "True" input (from a drop down list unless there is another
    > way to accomplish this)
    >
    > b-if any of the other cells already contain "True", they can not duplicate
    > the entry in the other cells and display an error message that says they can
    > answer "True" only once in the range of cells.


+ 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