+ Reply to Thread
Results 1 to 5 of 5

Formula To Convert Hours(time) to Numbers

  1. #1
    Registered User
    Join Date
    04-30-2005
    Posts
    2

    Formula To Convert Hours(time) to Numbers

    Am tracking employees time. Punch in/Punch out. Then, I want to take the time worked, turn the "time" into numbers so I can use that number to calculate different costs.

    Here's what I've got so far:

    A1 - Format Time 00:00 AM/PM
    B1 - Format Time 00:00 AM/PM
    C1 - Formula, B1-A1 - This gives me the time worked
    D1 - Formula, C1-TIME(8,0,0), This gives me the amount of overtime worked.

    I need to know how to get the information in C1, which is in time format, changed to a number format.

    e.g., C1 tells me that 8:30 (hrs) have been worked.

    D1 is for vehicle cost. Let's say it costs $12.00/hr. to run a vehicle. Is there a formula which would convert the information in C1 (time format) into a number format so I can times it by $12?

    In D1, I've tried C1*12, the answer I get is, 12. I have no idea what that means. The answer I'm looking for would be 102 (which is 8.5hrs x 12).

    I don't know if this is possible, but I hope it is.

    Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    format d2 cell with number and paste the this value in the d1 cell:

    =((HOUR(D5)-HOUR(C5))+((MINUTE(D5)-MINUTE(C5))/60))

  3. #3
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    The clever thing about Excel time format is that it actually is the number of hours divided by 24. So...
    8/24 = 1/3 =0,3333333... and with Time format it becomes 08:00
    You can see this by changing the format from Time to General.

    So in your case:
    Time in: 08:00
    Time out: 15:00
    Hours worked: =(15:00-08:00)*24 formatted as General --> 7.00

    Once you know this, then it is very easy to count with time in Excel.

    Hope it helped
    Ola Sandström

  4. #4
    Registered User
    Join Date
    04-30-2005
    Posts
    2
    Thank you for the formula, and thanks for the explanation of how Excel works with time.

    Both messages have helped me a great deal.

  5. #5
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    Y're welcome

+ 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