+ Reply to Thread
Results 1 to 7 of 7

Data Validation Question

  1. #1
    Registered User
    Join Date
    04-03-2006
    Posts
    33

    Data Validation Question

    Hi, I have the following formula that i use, is there a way to have the numbers in a worksheet as they will change ie.. numbers will be added and removed.

    =AND(OR(AND(B3>=121,B3<=125),AND(B3>=149,B3<=156),AND(B3>=320,B3<=363),AND(B3>=700,B3<=799),AND(B3>=800,B3<=991)),COUNTIF($B$3:$E$46,B3)<2)

    Regards

    David

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    In (say) K1:L5 put
    121 125
    149 156
    320 363
    700 798
    800 991

    then use

    =AND(OR(AND(B3>=K1,B3<=L1),AND(B3>=K2,B3<=L2), AND(B3>=K3,B3<=L3),AND(B3>=K4,B3<=L4),AND(B3>= K5,B3<=L5)),COUNTIF($B$3:$E$46,B3)<2)

    HTH

    --

    Quote Originally Posted by dgraham
    Hi, I have the following formula that i use, is there a way to have the numbers in a worksheet as they will change ie.. numbers will be added and removed.

    =AND(OR(AND(B3>=121,B3<=125),AND(B3>=149,B3<=156),AND(B3>=320,B3<=363),AND(B3>=700,B3<=799),AND(B3>=800,B3<=991)),COUNTIF($B$3:$E$46,B3)<2)

    Regards

    David

  3. #3
    Registered User
    Join Date
    04-03-2006
    Posts
    33
    Thanks, If I choose to use another sheet, would I put "Sheet1!" in front of the cell range.

    David

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Whatever the name of the sheet you choose to use to store the numbers, yes.

    =AND(OR(AND(B3>=Sheet4!K1,B3<=Sheet4!L1),AND(B3>=Sheet4!K2,B3<=Sheet4!L2), AND(B3>=Sheet4!K3,B3<=Sheet4!L3),AND(B3>=Sheet4!K4,B3<=Sheet4!L4),AND(B3>=Sheet4!K5,B3<=Sheet4!L5)),COUNTIF($B$3:$E$46,B3)<2)

    --

    Quote Originally Posted by dgraham
    Thanks, If I choose to use another sheet, would I put "Sheet1!" in front of the cell range.

    David
    Last edited by Bryan Hessey; 04-26-2006 at 11:32 PM.

  5. #5
    Registered User
    Join Date
    04-03-2006
    Posts
    33
    Thank Brian,

    When I use another sheet I get an error message "You may not use references to other worksheets or workbooks for Data Validation criteria" I guess that means I can't do it?

    Regards

    David

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    . . ... Data Validation?
    was not mentioned (except as a topic).

    If you are using data validation on the data to check validity against the permitted ranges in the table you could duplicate the table into the current sheet, with (say) AK1:AL5 = Sheet4!AK1 etc

    --

    Quote Originally Posted by dgraham
    Thank Brian,

    When I use another sheet I get an error message "You may not use references to other worksheets or workbooks for Data Validation criteria" I guess that means I can't do it?

    Regards

    David

  7. #7
    Forum Contributor
    Join Date
    12-02-2004
    Location
    London
    Posts
    255
    You can put the table onto another sheet, but instead of using cell references, you use named ranges. Data Validation works with cell references, as long as they are in the same sheet, but stangly Data Validation will work if you use named ranges, which refer to cells in another sheet.

+ 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