+ Reply to Thread
Results 1 to 5 of 5

Subtraction of H:MM

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Subtraction of H:MM

    I am trying to set up a timesheet that will automatically add up the hours worked for each day (stop time - start time), then sum up the week and convert it to a decimal (need 4.5 hours vs. 4:30). I have the conversion from H:MM to a decimal, but for some reason the hours are not summing up properly once they go over 24 for a given week. If they are under 24, then the formulas work fine. What am I doing incorrectly?
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Subtraction of H:MM

    Hi Sbossio, welcome to the forum.

    If you're trying to total hours greater than 24, format the cell(s) as:

    [h]:mm instead of h:mm

    Hope that helps, I can't confirm since the spreadsheet you uploaded is protected with a password.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Subtraction of H:MM

    Welcome to the forum.

    Please don't post workbooks with protected worksheets.

    Change the formula in Q13 to

    =24*SUMPRODUCT(-1^(COLUMN(C13:P13)- COLUMN(C13) + 1), C13:P13)
    Last edited by shg; 06-21-2011 at 05:50 PM.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Subtraction of H:MM

    Another alternative....

    =SUM(SUMIF(C$12:P$12,{"Stop","Start"},C13:P13)*{24,-24})

    ...or this one...

    =(SUM(C13:P13)-2*SUMIF(C$12:P$12,"Start",C13:P13))*24
    Audere est facere

  5. #5
    Registered User
    Join Date
    06-21-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Subtraction of H:MM

    That worked like a charm. Thank you all for your help.

    Sorry about the protected worksheet. I had two copies saved and uploaded the wrong one. The lesson as always, I'm an idiot. My apologies and thanks again.

+ 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