+ Reply to Thread
Results 1 to 5 of 5

Data Validation for dates & time exceeding 24hrs

  1. #1
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile Data Validation for dates & time exceeding 24hrs

    Hi Guys,

    I wanted to enter a data validation for a column in a spreadsheet I am designing.

    The problem is; if I use the Time in the 'Allow' combo box and then between in the 'Data' combo box, I set the start time as 0:00 and I wanted to set the end time as 999:00 as I am dealing with total hours worked and not hours within 24 hours if you get what I mean.

    The problem is sometimes I need to enter large hours such as 521 hours for example.

    Is there a way that I can set maybe a wildcard format so that as long as the time format is h:mm it will accept it.

    The Time cell is formatted as: [h]:mm.

    My second problem is with dates. I have another sheet on the spreadsheet for checking vacancies. in the first column is 'Date from' and the second column is 'Date to' for the required vacancy for temp staff. The third column then calculates how many weeks the temp member of staff is needed by simply subtracting the 'Date from' from 'Date to'.

    I wanted a Validation in the 'Date to' column so that if a date is entered that is lower than the 'Date from' date then it will flag up an error as I don't want to be dealing with negative dates.

    How can I achieve this?

    Thanks in advance for any help offered.
    Best Regards.

    Michael
    -----------------------------------
    Windows Vista, Microsoft Office 2007

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Well perhaps the following may work

    1) In the data validation choose dates rather than time and choose between 1/1/1900 and 10/2/1900 15:00 (assuming dmy date format) these are the values for 0 and 999 hours respectively. You can still format the cell as [h];mm

    2) As it is not clear if the start or the finish date is the error you could choose conditional formating and select the range of start date. If the range starts in cell c3 choose cell value, greaterthan or equal to d3. then say choose a highlight colour to draw your attention to it

    Does that work?


    Regards

    Dav

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    you need to divide the value by 24 such as
    =521/24
    then you need to custom format the cell
    select cell, format,cells,number,custom
    enter this in the box

    [h]:mm

  4. #4
    Forum Contributor
    Join Date
    03-30-2007
    Location
    London, UK
    MS-Off Ver
    Microsoft Office 2007
    Posts
    317

    Smile

    @Dav

    Thanks for your help. The date format works fine for any hours up to 999:00, but for some reason if I enter 0:00 or even 0:01 as a time it says that it is invalid. Any ideas on what's gone wrong?

    Thanks.

    @davesexcel

    I'm not quite sure what you mean. I have already formatted the cell in the custom format of [h]:mm so that I can have total hours greater than 24hrs.

    I wanted to restrict users from only being able to enter time from 0:00 to 999:0.

    Thanks.

  5. #5
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Yes ther problem is it does not like a date before 01/01/1900 so does not allow you any value less than 24:00

    However if you change the criteria to less than and equal to 10/02/07 15:00 it should work

    Does it?

    Regards

    Dav

+ 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