+ Reply to Thread
Results 1 to 4 of 4

Calculate number of hours in timesheet

Hybrid View

  1. #1
    Registered User
    Join Date
    04-22-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    1

    Calculate number of hours in timesheet

    I need to calculate the number of hours between 8 a.m. and 5 p.m. less one hour for lunch so the total hours for the day is 8. This is for the Holiday Pay column on our office timesheet. I have part of the formula which is =(J3-I3)*24-1, but it doesn't work on days where there isn't any time entered. It automatically calculates it as -1. Is my formula incorrect?

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Calculate number of hours in timesheet

    Give this a try:

    =IF(J3-I3<1,0,(J3-I3)*24-1)
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Calculate number of hours in timesheet

    Try this:
    =IF(SUM(I3:J3)=0,0,(J3-I3)*24-1)

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

    Re: Calculate number of hours in timesheet

    Assuming that you only want to calculate the hours when both cells are populated try

    =IF(COUNT(I3,J3)=2,(J3-I3)*24-1,"")
    Audere est facere

+ 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