+ Reply to Thread
Results 1 to 7 of 7

Data validation with multiple rules

  1. #1
    Registered User
    Join Date
    05-07-2016
    Location
    Wellington, New Zealand
    MS-Off Ver
    2010
    Posts
    2

    Data validation with multiple rules

    Hi,
    I can't seem to figure out how to make a custom data validation work for multiple rules... Hoping you lovely people could help me figure out where I'm going wrong?!

    I'm creating a spreadsheet for data input and need to make sure that the numbers going in a range of cells (B6-B36) are only whole numbers equal to, or greater than, zero (no negative numbers) with a maximum of 1 decimal point.

    I've tried breaking down the rules and come up with this: =AND(ROUND(B6,1),MOD(B6,1)=0,B6>0)
    But it didn't work...


    Your help is much appreciated!!
    Last edited by Rockguts; 05-07-2016 at 11:34 PM. Reason: Solved

  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 with multiple rules

    Maybe this...

    =AND(B6>=0,TRUNC(B6,1)=B6)

    I interpret this:

    Quote Originally Posted by Rockguts View Post
    equal to, or greater than, zero
    To mean: >=0

    In your formula you have: >0
    Last edited by Tony Valko; 05-07-2016 at 07:22 AM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Data validation with multiple rules

    Hi,

    Will this work for you?


    Regards

    peterrc
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    05-07-2016
    Location
    Wellington, New Zealand
    MS-Off Ver
    2010
    Posts
    2

    Re: Data validation with multiple rules

    Thanks Tony! This code worked great

    Thanks Peter, unfortunately didn't quite work right, it was still allowing more than one decimal point.

  5. #5
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Data validation with multiple rules

    Hi,

    Can you not just format the cells in that column to number with one decimal place?

    Regards

    peterrc

  6. #6
    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 with multiple rules

    You're welcome. Thanks for the feedback!

  7. #7
    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 with multiple rules

    Quote Originally Posted by peterrc View Post
    Can you not just format the cells in that column to number with one decimal place?
    That would limit the DISPLAYED value to 1 decimal place but that doesn't stop a user from entering a number with more decimal places which would be the true underlying value of the cell.

+ 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. [SOLVED] IF AND / OR Statement for Data Validation rules
    By DPaton in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-30-2014, 12:53 AM
  2. [SOLVED] multiple validation rules
    By Mayrie in forum Excel General
    Replies: 8
    Last Post: 09-07-2012, 08:50 PM
  3. [SOLVED] Can Multiple Data Validation Rules be Defined for the Same Range
    By PosseJohn in forum Excel General
    Replies: 1
    Last Post: 08-16-2012, 01:19 PM
  4. Seeing which cells have Data Validation rules
    By marketshare in forum Excel General
    Replies: 5
    Last Post: 03-27-2011, 07:51 PM
  5. validation rules not working when someone copy paste data on validation cell
    By jthakrar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-17-2010, 03:36 AM
  6. Replies: 2
    Last Post: 01-03-2010, 05:21 PM
  7. Replies: 3
    Last Post: 10-05-2009, 03:04 PM
  8. [SOLVED] Data Validation Rules
    By Louise in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-10-2006, 08:10 AM

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