• two days time period (Office 2003)

    Author
    Topic
    #415524

    On Monday at (b12)19:54:57 we started a job that ran until the next day at (d12)12:20 pm. How can I figure out the total number of hours? I tried D12 – B12.

    Viewing 1 reply thread
    Author
    Replies
    • #926914

      The best solution is to put the date+time in the cells. You can then use =D12-B12. This will be a date/time value. If you really need the number of hours, multiply by 24: =24*(D12-B12)

      Alternatively, you can put the dates and times in separate cells, say date1 in A12, time1 in B12, date2 in C12, time2 in D12. You can then use =(C12+D12)-(A12+B12). Again, this will be a date/time value. To get the number of hours, use =24*((C12+D12)-(A12+B12)).

      • #927166

        Hans,
        Can the square brackets not be used here too?
        If you minus the two time values and format the answer to [hh], it will give the total in hours as a value, not a time. Specifying [m] in square brackets will give the total number of minutes.

        • #927171

          Depends on what Daniel wants. If he just wants to see the time difference in hours, the [h] or [hh] format will do fine. If he needs to do further calculations with the number of hours, he will need to multiply by 24 somewhere along the line.

    • #927044

      … and the key to displaying hours in time format is to format the cell properly.

      Either do the maths as Hans suggests and get decimal hours by dividing by 24 into a number field

      Or use custom format and set it to [h]:mm:ss where th square brackets are required – then dividing by 24 isn’t needed.

      • #927155

        We tried doing the format cells but that wouldn’t work. We did the formula and got it going.

        Thanks

    Viewing 1 reply thread
    Reply To: two days time period (Office 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: