+ Reply to Thread
Results 1 to 5 of 5

Excel Data Validation with Mixed Criteria

  1. #1
    Registered User
    Join Date
    11-17-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2003
    Posts
    2

    Excel Data Validation with Mixed Criteria

    I need to add data validation to a cell in Excel 2003. The cell should accept any whole number from 0 to 500,000 or "NA" for not applicable. Can anyone show me how to do this?

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Excel Data Validation with Mixed Criteria

    Hi BP05, and welcome to the forum.

    Try setting the Data Validation for that cell to Custom, and use the following formula (change G1 to your actual cell being referenced):

    =OR(G1="NA",IF(ISNUMBER(G1),AND(INT(G1)-G1=0,G1>=0,G1<=500000),FALSE))

  3. #3
    Registered User
    Join Date
    11-17-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Excel Data Validation with Mixed Criteria

    Paul, this is wonderful, but my manager now wants it to accept decimal values. Is there a way to get it to accept a whole number and/or a decimal? Thanks!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Excel Data Validation with Mixed Criteria

    You should be able to just remove the INT test, e.g.

    =OR(G1="NA",IF(ISNUMBER(G1),AND(INT(G1)-G1=0,G1>=0,G1<=500000),FALSE))

    becomes

    =OR(G1="NA",IF(ISNUMBER(G1),AND(G1>=0,G1<=500000),FALSE))

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Excel Data Validation with Mixed Criteria

    Actually, after thinking for a second, you should just be able to use:

    =OR(A1="NA",AND(ISNUMBER(A1),A1>=0,A1<=500000))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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