+ Reply to Thread
Results 1 to 4 of 4

need help with formula for time

  1. #1
    Registered User
    Join Date
    11-17-2006
    Posts
    2

    need help with formula for time

    I'm trying to calculate the number of hours worked when it crosses over to a new day. For instance, 15:00 to 2 a.m. the next day. When I use the formula +b2-a2+if(a2>b2,1) the result is .54. Can anyone tell me what I can do to resolve this and come up with the correct value of 12 hours? I've also tried using 24 in place of the 1 and it gives me the same result.

    Please help!

  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
    Hi,

    Have a look at this link

    http://www.excelforum.com/showthread.php?t=580820

    Or you could check out Chip Pearson website

    http://www.cpearson.com/excel/overtime.htm

    This might help

    =(A3-A2+(A3<A2))*24

    Format as Number and 2 Decimal places


    VBA Noob
    Last edited by VBA Noob; 11-17-2006 at 07:40 PM.
    _________________________________________


    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
    11-17-2006
    Posts
    2

    need help with formula for time

    I got the help I needed from the Cpearson.com site.

    Thanks for your help!

  4. #4
    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
    Glad you got it

    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