+ Reply to Thread
Results 1 to 8 of 8

Thread: timesheet formula

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    Oklahoma, OKC
    MS-Off Ver
    Excel 2007
    Posts
    4

    timesheet formula

    I need a formula that will calculate time worked(b-a). Automaticlly take out a lunch only if they have worked < 5hrs, rounded to the nearest 0.25.
    Can somebody please help Ive looked all over the internet and tryed several formulas, but cant seem to get it to work the way I would like.
    Last edited by NBVC; 01-26-2012 at 08:13 AM.

  2. #2
    Registered User
    Join Date
    12-27-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: I need help with a formula on a timesheet.

    How Long would lunch be? 1 hr? so if they worked 4 hours? make it -1 so it's 3 hours?

  3. #3
    Registered User
    Join Date
    12-27-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: I need help with a formula on a timesheet.

    I can round to the nearest 2 digits... but i can't specifically do .25.

  4. #4
    Registered User
    Join Date
    01-25-2012
    Location
    Oklahoma, OKC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: I need help with a formula on a timesheet.

    Lunch would be 30 min only if they work more than 5 hrs

  5. #5
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: I need help with a formula on a timesheet.

    Does this work?

    =((B1-A1+(B1<A1))*24)-(0.5*(B1<A1))

    where A1 has start time, B1 has end time.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    01-25-2012
    Location
    Oklahoma, OKC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: I need help with a formula on a timesheet.

    It calculated the time but didnt take out the 30 min lunch.

  7. #7
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: timesheet formula

    How about?

    =((B1-A1+(B1<A1))*24)-IF(((B1-A1+(B1<A1))*24)>5,0.5,0)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Registered User
    Join Date
    01-25-2012
    Location
    Oklahoma, OKC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: timesheet formula

    Yes that works great thank you.

+ 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.2.0