We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Excel help please

gallygirl
gallygirl Posts: 17,240 Forumite
Part of the Furniture 10,000 Posts Photogenic Name Dropper
Is it possible to calculate the total number of hours between two dates, say 09:00 on 3/1/15 to 06:20 on 5/1/15? I know how to calculate as long as it's within the same day but the formulae only work up to 24 hours.

Thanks
A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort
:) Mortgage Balance = £0 :)
"Do what others won't early in life so you can do what others can't later in life"

Comments

  • warwicktiger
    warwicktiger Posts: 1,106 Forumite
    you can take one date away from another, leaving the answer in days then multiply by 24, and add the "odd hours"
  • SnowMan
    SnowMan Posts: 3,890 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    As per warwicktiger so formula would be

    =ROUNDDOWN((A2-A1)*24,0)
    I came, I saw, I melted
  • gallygirl
    gallygirl Posts: 17,240 Forumite
    Part of the Furniture 10,000 Posts Photogenic Name Dropper
    Thanks, will give it a go later when on laptop :).
    A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort
    :) Mortgage Balance = £0 :)
    "Do what others won't early in life so you can do what others can't later in life"
  • SteveJW
    SteveJW Posts: 732 Forumite
    Part of the Furniture 500 Posts Name Dropper Combo Breaker
    Excel 2010 and above can do this without formulas
    Not sure about earlier versions

    e.g.

    Cell A1 select custom format dd/mm/yyyy hh:mm type in (01/01/2015 06:30)
    Cell B1 copy the custom format dd/mm/yyyy hh:mm type in(01/02/2015 06:45)
    Cell C1 select custom format [h]:mm:ss
    Cell C1 = B1 - A1 = 744:15:00
    Format [h]:mm:ss disregards 24hrs
  • gallygirl
    gallygirl Posts: 17,240 Forumite
    Part of the Furniture 10,000 Posts Photogenic Name Dropper
    Can do the first part and calculate days, and multiply by 24 to give hours.

    Can do the second part and calculate the difference in odd hours.

    I can't manage to add the two together though as I can't get the same format in both answers.

    Steve I have an earlier version and it won't work.

    Any ideas, or just stop being so lazy and calculate manually?
    A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort
    :) Mortgage Balance = £0 :)
    "Do what others won't early in life so you can do what others can't later in life"
  • SteveJW
    SteveJW Posts: 732 Forumite
    Part of the Furniture 500 Posts Name Dropper Combo Breaker
    gallygirl

    What version of excel have you got and what operating system are you using

    If I remember correct you can type in the formatting manually

    Try starting a new workbook
    Cell A1 right click, drop down menu, select format cells, select custom
    If the format dd/mm/yyyy hh:mm is not available you can type it in manually

    C:\Users\Administrator.WIN7-PC06\Pictures\Jackie\Excel.jpg
  • System
    System Posts: 178,410 Community Admin
    10,000 Posts Photogenic Name Dropper
    edited 4 January 2015 at 1:47PM
    Hi

    Apart from the formatting mess, I hope this is understandable

    If you set the date formula as a custom, and enter it as given earlier, it seems to work quite nicely.

    The number of hours is adjusted, adding 8 on for the 1st time difference and then taking 2 off for the second.

    20 October 1940 21 November 2012 631920
    20/10/1940 08:00 21/11/2012 16:00 631928
    20/10/1940 18:00 21/11/2012 16:00 631918

    14904 41234 =SUM(B1-1)*24
    14904.3333333333 41234.6666666667 =SUM(B2-A2)*24
    14904.75 41234.6666666667 =SUM(B3-A3)*24


    Then changing the dates...

    01 January 2015 01 January 2015 0
    01/01/2015 08:00 01/01/2015 16:00 8
    01/01/2015 18:00 01/01/2015 16:00 -2
    This is a system account and does not represent a real person. To contact the Forum Team email forumteam@moneysavingexpert.com
  • SteveJW
    SteveJW Posts: 732 Forumite
    Part of the Furniture 500 Posts Name Dropper Combo Breaker
    Go to the following link and download the file, this is an example in Excel 97- 2003 format.
    Guaranteed virus free
    As previously stated no need to do any multiplication just take one date and time away from the other
    If link doesn't work send me a PM

    https://dl.dropboxusercontent.com/u/87238169/Date%20and%20Times.xls

    Steve
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.