Calculating between dates and times

  • I need to be able to calculate the length of time (in hours) between two times and dates.


    I have four cells, one each for start date and start time as well as end date and end time. Is there an easy way of doing this?


    I can work out the number of full days between the dates using =DAYS360 and multiplying it by 24 and get the times by subtracting them to find the hours. But the problem is when it is less than 24 hours.


    I know there is a way to do this but my mind has gone blank. Any help would be greatly appreciated.

  • Re: Calculating between dates and times


    Surely simply combining the date/times for start and end, and then subtracting ( formatted as [HH]:MM ) will do this?


    Code
    =(C1+D1)-(A1+B1)

    Cheers, Glenn.


    Beauty is in the eye of the beer-holder.

  • Re: Calculating between dates and times


    =((C1+D1)-(A1+B1))*24
    where
    C1 = end date
    D1 = end time
    A1 = start date
    B1 = start time


    format the result as general

    In formulae, depending on your locale, you might have to replace ; with , or vice versa.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!