+ Reply to Thread
Results 1 to 7 of 7

Work hours calculating start and end times

  1. #1
    Registered User
    Join Date
    03-28-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Work hours calculating start and end times

    Okay, this should probably be an easy answer but I seem to be having a brain block.
    Example =(F142-G142)*24
    my start time is 10am and end time is 3pm I know my hours worked aren't 7 it is 5 what am I missing?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Work hours calculating start and end times

    The formula works fine. It must have something to do with your entries in F142 and G142.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Work hours calculating start and end times

    What is in F142 and G142?

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Work hours calculating start and end times

    Should it be end time - start time?

    =(G142-F142)*24

    I get 5
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    03-28-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Work hours calculating start and end times

    I have made a userform that returns a time value into the cells and those cells are formatted to the time value the reason for F142 and G142 is that is just where I happened to be when I thought that I would try to create this formula. Do you think it is the way it was set up in the userform? My first intention was to do the calculations within the form but I am a newbie to VBA, that would make seasoned users cringe by the sight of my codes :/ and when I do it the other way as Jeff has suggested I get a negative number. I have attached my workbook if that helps I was just trying to create the formula on the excel employee timesheet tab.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-28-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Work hours calculating start and end times

    Please ignore the blue writing at the top of it when opening, I had asked a different question then decided to try a different direction which is where this question came.

  7. #7
    Registered User
    Join Date
    03-28-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Work hours calculating start and end times

    Thank you for your help guys, I figured it out, just have to make sure the AM and PM is listed in the userform. Maybe I should use military time instead =) 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