+ Reply to Thread
Results 1 to 5 of 5

Help with data validation - problems with dates and times

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Geneseo, IL
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question Help with data validation - problems with dates and times

    I need help with a data validation issue.

    I am trying to use data validation in some cells to restrict what people can enter into cells. In my spreadsheet, there are cells where times are entered and other cells very near this where number values are entered. I was trying to use data validation to restrict people from accidentally entering a time into a cell that is designed for only numbers.

    I have my data validation set up to allow decimal values of numbers between 0 and 500 and the formatting of the cell setup as a decimal format with 2 decimal places. The problem is that when I test my validation and enter a time of 07:00 into the cell, excel then turns this into a decimal value automatically. Because of this, the data validation does not reject the time input in that cell as I want it to. I want excel to keep this time as it is entered, and not automatically convert it to a decimal so that my data validation will reject it, but I can't figure a way to make this work.

    Is there any way I can keep excel from turning the time automatically into a decimal value?

    I know that I can set the formatting of my cell to text, and that keeps excel from turning the time into a decimal value automatically and keeps them as entered. But if I do that then it treats the numbers I enter into this cell as text as well and then the data validation I have setup rejects all numbers entered into the cell as well.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help with data validation - problems with dates and times

    cant see how,since times are a fraction of 24 hours expressed as a decimal there is no difference between
    0.125 and 03:00
    cross post @
    http://www.mrexcel.com/forum/excel-q...e-decimal.html
    Last edited by martindwilson; 03-21-2013 at 08:39 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,581

    Re: Help with data validation - problems with dates and times

    Pl see the attached file .A1 cell is validated .It will not accept timeentry in the form hh:mm.
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help with data validation - problems with dates and times

    clever never though of that!

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,581

    Re: Help with data validation - problems with dates and times

    Thanks for the compliments Mr martindwilson.

+ 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