+ Reply to Thread
Results 1 to 6 of 6

employee time sheet hours

  1. #1
    Registered User
    Join Date
    10-28-2007
    Location
    Broken Arrow, OK
    Posts
    50

    employee time sheet hours

    I am making a time sheet that calculate employee hours scheduled using a simple formula (b2-a2). My problem is when the scheduled out time goes to the next day (6:00pm to 1:00am) excel returns "#value". Please help.

    dude2125

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =B1-A1+(A1>B1)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-28-2007
    Location
    Broken Arrow, OK
    Posts
    50
    That helped Thank You! I would also like to know if there is a way to convert the result into decimal form in the same formula.

    dude2125

  4. #4
    Registered User
    Join Date
    10-28-2007
    Location
    Broken Arrow, OK
    Posts
    50
    I have ran into another issue. If an employee is scheduled from 9 am to 5 pm the above formula calculate the time wrong 16 hours instead of 8.

    dude2125

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =(B1-A1+(A1>B1))*24
    or
    =(B1-A1)*24+(A1>B1)*24
    VBA Noob

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I've assumed start time in A1 and end time in B1

    VBA Noob

+ 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