+ Reply to Thread
Results 1 to 4 of 4

Data Validation - Numeric to include "zeros"

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    Denver CO USA
    MS-Off Ver
    Excel 2007/2010
    Posts
    18

    Data Validation - Numeric to include "zeros"

    Below is the formula that I would like to use with only one major modification Where "zeros" should show too. Not on empty cells, only if it is input.
    The input reprsents time in 24 hour format. Such as 1300, (hrs), 2300, 0600, 0000 (instead of 2400). When I input any number that is preceded by a "0", (I.e. 0700, 0230, 0000,), I receive an error message. all other numbers not preceded by "0", works fine.
    Any help on modifiying the formula to allow the cell to accept numbers preceded by "0", is greatly appreciated.


    Here's the formula:

    =AND(ISNUMBER(A1),LEN(A1)=4)

    Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Data Validation - Numeric to include "zeros"

    The time preceeded by zeros is interpreted as text.
    VALUE will convert the text to numbers ie:
    =value(A1)

    Try this:
    =AND(Value(A1), LEN(A1)=4)
    Click on star (*) below if this helps

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    Saldanha, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Data Validation - Numeric to include "zeros"

    If it's preceded by a zero then it's not a number anymore (in the strict sense). You can change your data validation to Whole Number between 0 and 2359 and format your cells as Custom and enter 0000, this will automatically add a zero infront if not entered.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation - Numeric to include "zeros"

    Maybe:

    =AND(ISNUMBER(A1+0),LEN(A1)=4)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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