+ Reply to Thread
Results 1 to 10 of 10

How to type in 2 decimal places in 1/4 hour display

Hybrid View

  1. #1
    Registered User
    Join Date
    03-20-2008
    Posts
    5

    How to type in 2 decimal places in 1/4 hour display

    Hello all.
    MS EXCEL 2000

    I have to change a time sheet that was previously in HH:mm to display in decimals, but to the nearest 1/4 hour ( 0.25 (=15 mins), 0.50 (= 30 mins), 0.75 (=45 mins), and 1.00 (1 hour))

    This is not a formula question, but a format/display question as the cells have to be typed in by different people who up until now have beeb used to typing in the HH:mm format.

    This means;
    8:15hrs would become 8.25
    8:30hrs would become 8.5
    8:45hrs would become 8.75

    The reason behind the change is a head office wallah that needs to have time in decimals and not true minutes.

    Is there a way to;
    prevent user from entering any decimal other than .00; .25;.50;.75
    or change formatting to turn red if any other than above is entered.

    Alternatively, is there a way of me (the collator for 50 people) being able to take data from their sheets (which I have to do monthly) which could be a formula...

    I have tried to get head office to change, but they say that they collate data for 13 other sites and all the others are OK (thats cos all the others receive their data on PAPER and one person tabluates them)...

    Any suggestions...

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You can't do it with formatting, becuase the underlying numbers need to be different. If A1 has a time (e.g., 8:25), then =ROUND(A1 * 24 * 4, 0) / 4 and formatted as 0.00 displays the decimal hours to the nearest quarter-hour (8.50).
    Last edited by shg; 03-20-2008 at 03:37 PM.

  3. #3
    Registered User
    Join Date
    03-20-2008
    Posts
    5
    I dont know if I have explained myself properly, the people filling the new sheets in, dont need to put the : to make the cell time (they used to on previous versions as we had the output in HH:mm.

    As of April a new sheet will be available (if I get my finger out), they can type any decimal they want, but it must be rounded to the amounts above, If you take away the fact that its a timesheet, and think of it as pure data entry, it might make it simpler to see what I am looking for.

    Thanks for the speedy reply BTW

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    If they can then enter, say 8.35, you could use =ROUND(A1*4,0)/4 to get to the quarter hour.

  5. #5
    Registered User
    Join Date
    03-20-2008
    Posts
    5
    Quote Originally Posted by darkyam
    If they can then enter, say 8.35, you could use =ROUND(A1*4,0)/4 to get to the quarter hour.
    That works for me.

    Obviously I cannot have this forumula in the same cell, to I assume, I should have 'helper' columns with the formulae in, and then reference these on my master sheet which shows all detail for the 50 or so staff.... Or would it be better to have the forulae run on my single sheet (which I have control over and does not need to look so smart) as opposed to the ones they fill in.

    I will have a play.

    Thanks for your help

  6. #6
    Registered User
    Join Date
    03-20-2008
    Posts
    5
    Also, if the people who fill the sheets in, accidentally enter a : as they have done for the last two years, Excel will treat the result as a date/time, and wont work for the rest of my formulae.

    Ive looked at conditional formatting to try and prevent this (ie if a : is enterered) but not been successful.

    Could I format the cells as decimals and somehow lock them from having their format changed? or have the cell turn red if a time is entered?

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    I don't think data validation will work, but you can do conditional formatting to turn cells red with =MOD(A1,1/96)>0.
    As shg said, you can't have formatting change the underlying number; however, with a helper column, you can change time whether entered as decimal or h:mm with this formula: =IF(A1>1,ROUND(A1*4,0)/4,ROUND(A1*96,0)/4). Note that this will give you the hours as numbers greater than 1, so if you need to convert back to hours for showing in Excel, you will have to divide the results by 24. HTH.

    Edit: I guess I'm not quite as quick as shg.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,994
    Consider using the DOLLARFR fn. Suppose you have time values in column A, put:
    =FLOOR(DOLLARFR($A2,24)*100,0.25)
    in col B and
    =CEILING(DOLLARFR($A2,24)*100,0.25) in Col-C, then:
    Time	Floor	Ceiling
    ------+-------+-------
    13:55	13.75	14.00	
    8:16	8.25	8.50	
    8:12	8.00	8.25
    Ben Van Johnson

+ 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