+ Reply to Thread
Results 1 to 5 of 5

data validation for excel cells integer number and A

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    kathmandu, nepal
    MS-Off Ver
    2007
    Posts
    15

    data validation for excel cells integer number and A

    I want to create a validation rule to validate such that the values must be between 0-100 (only positive integers) and 'A'. How can I apply this validation in excel?

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: data validation for excel cells integer number and A

    It must be a custom validation and here is the logic: =IF(ISNUMBER(B2),AND(B2>=0,B2<=100,B2=INT(B2)),B2="A")
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-16-2014
    Location
    kathmandu, nepal
    MS-Off Ver
    2007
    Posts
    15

    Re: data validation for excel cells integer number and A

    Hello dflak ,
    Thank You for your reply. I want to check if the cell is empty or not. In case of NULL, it should throw error. I tried from this link https://www.extendoffice.com/documen...low-blank.html but it's not working. What I did is ::
    Please Login or Register  to view this content.
    but this is throwing error.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: data validation for excel cells integer number and A

    You could also create a List of the 100 numbers and A and use the List option in the DV.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: data validation for excel cells integer number and A

    I want to check if the cell is empty or not. In case of NULL, it should throw error.
    As far as I can see dflak's formula as-is does as well as is possible in making sure that the current cell is not left "empty". What the "countif" formula that you found does in addition is make sure that the user does not skip any rows. For example if you have valid data in E2:E4 and then try to make an entry in E6 (skipping E5) then you will get a validation error.

    If you are designing this worksheet for others to use then I would recommend you create a custom input message which defines what the valid inputs are. I would also create a custom error alert message if you are going with the "countif" addition because if someone attempts to skip a row then the actual error is with the previous cell and not the current cell which is contrary to what the standard error message implies.

    Finally in the Data Validation dialog box verify that "Ignore blank" is not checked.

    I tried from this link [ . . . ] but it's [countif formula] not working.
    Here is dflak's formula with the "countif" addition if you decide you need it.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by GeoffW283; 01-02-2019 at 06:21 PM.

+ 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. Replies: 4
    Last Post: 07-03-2014, 02:37 AM
  2. Replies: 4
    Last Post: 01-07-2014, 10:24 AM
  3. Adding Date Data Validation to cells with List Data Validation
    By biggtyme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2013, 09:47 AM
  4. Extending VB Code to Fill Excel Cells If Column Name Matches Data Validation
    By zigojacko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2013, 11:47 AM
  5. [SOLVED] Excel VBA problem about encrypting a 4 integer number
    By paliali21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2012, 12:16 AM
  6. Count the number of occurrences of an integer withing a larger integer
    By nnktran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2010, 01:04 PM
  7. [SOLVED] Determine if cells are used for data validation in Excel
    By Brettjg in forum Excel General
    Replies: 0
    Last Post: 06-12-2006, 11:15 AM
  8. [SOLVED] excel-enter integer number and get two decimal places
    By Jack H in forum Excel General
    Replies: 2
    Last Post: 10-16-2005, 05:05 PM

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