Calculate night bonus on time sheet

Hello,
I wonder if there is a formula to calculate the number of hours finding themselves in within a specified period during a work shift .
Employees have a night shift premium for hours worked between 1:00 ET 7:00. If their shift ends after 1:00 or if their shift starts before 7:00 , time accumulated. Here is my example:
start
end
total
night hours (between 1h00 to7h00)
20h00
02h00
6h
1
04h00
13h00
9h
3h
23h00
08h00
9h
6h
What is the formula for calculating the number of hours worked between 1:00 ET 7:00 ?
Thank you !

Hi,
Please try this:
F2:=IF(C2<B2,1+C2-B2,C2-B2)*24
G2:=(IF(C2<=B2,IF(MIN(1+C2,E2)<MAX(B2,D2),0,MIN(1+C2,E2)-MAX(B2,D2)),IF(MIN(C2,E2)<MAX(B2,D2),0,MIN(C2,E2)-MAX(B2,D2)))+IF((C2<B2)*(C2>D2),C2-D2,0))*24
Regards,
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs.

Similar Messages

  • Question fractions of an hour formulas on Time Sheets

    I am trying to build a time sheet. Sometimes the time entered needs to be less than one hour. But when it then multiplies by the hourly rate, I get a problem.
    The formula calculates the "hours" by subtracting the start time from the end time in the fields where I enter them. If those total less than one hour, it either changes the duration to "minutes" or if I force it to hold the duration at hours, it always rounds up to one hour. As an example, a reported task that runs from 11:30 a.m. to 12 p.m. is entered, it usually posts a result of 30 minutes. But when it then goes to multiply the hourly rate, it multiplies by 30 (hours) rather than by 30 (minutes) or .5 (hours). How can I get it to post .5 hours so the math is right on the extended total?

    Assume cell a1 is formatted as date and time with only time shown. Enter data in form of h:m in that cell. Convert to fraction of hour that can be multiplied by hourly rate with formula as follows: =timevalue(a1)*24. Add in hourly rate as follows: =timevalue(a1)24[rate value].

  • Time sheet, rates, date dependent

    I am trying to figure out the best database design for the following;
    I have individuals (stored in Agents table) that enter their billing or time worked each day for different projects. Now we have different rates that we pay based on the person and what
    the project is. And we also have to account for individuals getting pay cuts or raises over time. So....
    I have the following tables;
      Agents - table of each person
      Projects - table of all projects we work
      Rates - table with AgentID, ProjectID, StartDate, EndDate, Rate
      Billing - table with Date, AgentID, ProjectID
    So my current implementation a billing entry must be made by an agent, and I have to create a join to the rates table based on AgentID, ProjectID, and Date between StartDate and EndDate.
    This just seems incredibly ugly and all the billing data can be easily changed if a change were made to the rates. I'm assuming most time sheets calculate the total rate and store it in the table so it never changes unless someone specifically goes back to
    update the data? I'm just wondering if there is a better method for tracking this sort of data. Thanks

    Based on your current database structure 
    Agent -   Unique record for each person
    Project - Unique record for each project
    Rates -   Unique record for agent and project
    Billing -   Unique record for agent and project
    So basically, you don't need billing table if you are fine with change in billing rate in the middle of any project.  
    But if you have to track the Employee cost per project then you might have to keep an entry in Billing table with billing start date, billing end date and active flag (kind of
    SCD type 2).
    Just a random thought again, you can also have a rate table only and make a new row every time rate is changed or billing is changed. but remember, if rate is changed then you must change the rate of existing employee in that current project (i.e. new row
    for all those employee also)

  • Help creating time worked field on time sheet.

    I am new to acrobat. I am creating a time sheet submittable form. I have start time fields and end time fields and now i need a field that  calculates total time worked in hours. I could do this using military time except that in the calculations tab in field properties there is no subtraction calculaton option, just addition. Is there anyway to acomplish this by writing a script? I know nothing abiut writing scripts, PLEASE HELP.

    You need to use JavaScript to write the custom JavaScript Code. You can convert the time string to a JS data object and do the math at milliseconds.
    You can split the time string into hours and minutes, convert the hours to minutes and add to the minutes, do the math in minutes and finally convert the minutes back into hours and minutes.
    Since you will be repeating the math for each day, I would look at creating a function to convert the time string cell to minutes for the computation.
    There can be problems with leading zeros and no separator symbols since the Number format strips the leading zeros from number character strings.
    function Time2Min(cTime){
    var min = 0
    var hr = 0
    cTime = cTime.toLowerCase();
    // civilian time
    if (/(\d{0,2})[:](\d{2})[ ]?([ap])/.test(cTime)) {
       hr =  Number(RegExp.$1);
       if (RegExp.$3 == "p") {
          hr += 12;
       min = (60 * hr) + Number(RegExp.$2);
       } // end civilian time
    // 24 hour time
    if (/(\d{0,2})[:](\d{2})/.test(cTime)) {
       min = (60 * Number(RegExp.$1)) + Number(RegExp.$2);
       } // end 24hour time
    // military time
    if (/(\d{0,2})(\d{2})/.test(cTime)) {
       min = (60 * Number(RegExp.$1)) + Number(RegExp.$2);
       } // end military time
    return min;
    } // end function
    function Min2HH:MM (nMinutes) {
    return util.printf("%,1 01.0f" + ":" + "%,1 02.0f", Math.floor(nMinutes / 60), Math.floor(nMinutes % 60));
    var elapsed = 0;
    var sEnd = "1600"; // change for field value as string
    var sStart = "0900" // change for field value as string
    // add loop to go through fields:
    if (sEnd != "" & sStart !="") {
    elapsed += (Time2Min(sEnd)  - Time2Min(sStart)) ;
    // end of loop
    // format the output
    Min2HH:MM(elapsed);

  • Monthly Time Sheet Dates

    I am building a monthly time sheet. I need all the dates to populate once the initial date is chosen by the user. I have this working properly for each month that has 31 days. For months with 30 days, it populates the first day of the next month. How do I make sure that the only the dates for the month selected are populated?
    Any help is appreciated!
    Tracy

    Hello!
    Thank you for your response, but I can not get it to function properly.
    I added a text field to calculate the number of days.  Here is the script I placed in the text field:
    form1.commentSub.NoofDays::calculate - (FormCalc, client)
    var StartDate = Ref(SubPg1.tableSub.Table1.Row1.Date1)
    var EndDate = Ref(SubPg1.tableSub.Table1.Row2.Date2)
    var MonthStart = Date2Num(Date1.formattedValue, "MM/DD/YYYY")
    var nMonth = Num2Date(MonthStart, "MM")                                                                                                     ; Current Month
    var nDay = Num2Date(MonthStart, "DD")                                           ; Current Day
    var nYear = Num2Date(MonthStart, "YYYY")                                        ; Current Year
    var nFirstDay = Date2Num(Concat(nMonth,"01", nYear), "MM/DD/YYYY")        ; First Day in the current month
    var nLastDay
    var nCountDays = nFirstDay
    StartDate.rawValue = Num2Date(nFirstDay, "MM/DD/YYYY") ; Set first day of month as start date
    ; Determine number of days in the current month
    var nMonthCheckStart = Num2Date(nFirstDay, "MM")
    var nMonthCheckEnd
    for i=0 upto 31 step 1 do
              nCountDays = nCountDays + 1
              nMonthCheckEnd = Num2Date(nCountDays , "MM")
              if(nMonthCheckStart == nMonthCheckEnd) then
                        nLastDay = nCountDays
              endif
    endfor
    EndDate.rawValue = Num2Date(nLastDay, "MM/DD/YYYY") ; Set lastday of month as end date
    $.rawValue = Num2Date(nLastDay, "DD") ; Set number of days this month
    In the date field where the user selects the date. I have this:
    form1.SubPg1.tableSub.Table1.Row1.Date1::exit - (FormCalc, client)
    var dayNum = Date2Num($.formattedValue,"MM/DD/YY")
    Row2.Date2.rawValue = Num2Date(dayNum+1,"MM/DD/YY")
    Row3.Date3.rawValue = Num2Date(dayNum+2,"MM/DD/YY")
    Row4.Date4.rawValue = Num2Date(dayNum+3,"MM/DD/YY")
    Row5.Date5.rawValue = Num2Date(dayNum+4,"MM/DD/YY")
    Row6.Date6.rawValue = Num2Date(dayNum+5,"MM/DD/YY")
    Row7.Date7.rawValue = Num2Date(dayNum+6,"MM/DD/YY")
    Row8.Date8.rawValue = Num2Date(dayNum+7,"MM/DD/YY")
    Row9.Date9.rawValue = Num2Date(dayNum+8,"MM/DD/YY")
    Row10.Date10.rawValue = Num2Date(dayNum+9,"MM/DD/YY")
    Row11.Date11.rawValue = Num2Date(dayNum+10,"MM/DD/YY")
    Row12.Date12.rawValue = Num2Date(dayNum+11,"MM/DD/YY")
    Row13.Date13.rawValue = Num2Date(dayNum+12,"MM/DD/YY")
    Row14.Date14.rawValue = Num2Date(dayNum+13,"MM/DD/YY")
    Row15.Date15.rawValue = Num2Date(dayNum+14,"MM/DD/YY")
    Row16.Date16.rawValue = Num2Date(dayNum+15,"MM/DD/YY")
    Row17.Date17.rawValue = Num2Date(dayNum+16,"MM/DD/YY")
    Row18.Date18.rawValue = Num2Date(dayNum+17,"MM/DD/YY")
    Row19.Date19.rawValue = Num2Date(dayNum+18,"MM/DD/YY")
    Row20.Date20.rawValue = Num2Date(dayNum+19,"MM/DD/YY")
    Row21.Date21.rawValue = Num2Date(dayNum+20,"MM/DD/YY")
    Row22.Date22.rawValue = Num2Date(dayNum+21,"MM/DD/YY")
    Row23.Date23.rawValue = Num2Date(dayNum+22,"MM/DD/YY")
    Row24.Date24.rawValue = Num2Date(dayNum+23,"MM/DD/YY")
    Row25.Date25.rawValue = Num2Date(dayNum+24,"MM/DD/YY")
    Row26.Date26.rawValue = Num2Date(dayNum+25,"MM/DD/YY")
    Row27.Date27.rawValue = Num2Date(dayNum+26,"MM/DD/YY")
    Row28.Date28.rawValue = Num2Date(dayNum+27,"MM/DD/YY")
    Row29.Date29.rawValue = Num2Date(dayNum+28,"MM/DD/YY")
    Row30.Date30.rawValue = Num2Date(dayNum+29,"MM/DD/YY")
    Row31.Date31.rawValue = Num2Date(dayNum+30,"MM/DD/YY")
    Row1.Day1.rawValue = Num2Date(dayNum,"EEE")
    Row2.Day2.rawValue = Num2Date(dayNum+1,"EEE")
    Row3.Day3.rawValue = Num2Date(dayNum+2,"EEE")
    Row4.Day4.rawValue = Num2Date(dayNum+3,"EEE")
    Row5.Day5.rawValue = Num2Date(dayNum+4,"EEE")
    Row6.Day6.rawValue = Num2Date(dayNum+5,"EEE")
    Row7.Day7.rawValue = Num2Date(dayNum+6,"EEE")
    Row8.Day8.rawValue = Num2Date(dayNum+7,"EEE")
    Row9.Day9.rawValue = Num2Date(dayNum+8,"EEE")
    Row10.Day10.rawValue = Num2Date(dayNum+9,"EEE")
    Row11.Day11.rawValue = Num2Date(dayNum+10,"EEE")
    Row12.Day12.rawValue = Num2Date(dayNum+11,"EEE")
    Row13.Day13.rawValue = Num2Date(dayNum+12,"EEE")
    Row14.Day14.rawValue = Num2Date(dayNum+13,"EEE")
    Row15.Day15.rawValue = Num2Date(dayNum+14,"EEE")
    Row16.Day16.rawValue = Num2Date(dayNum+15,"EEE")
    Row17.Day17.rawValue = Num2Date(dayNum+16,"EEE")
    Row18.Day18.rawValue = Num2Date(dayNum+17,"EEE")
    Row19.Day19.rawValue = Num2Date(dayNum+18,"EEE")
    Row20.Day20.rawValue = Num2Date(dayNum+19,"EEE")
    Row21.Day21.rawValue = Num2Date(dayNum+20,"EEE")
    Row22.Day22.rawValue = Num2Date(dayNum+21,"EEE")
    Row23.Day23.rawValue = Num2Date(dayNum+22,"EEE")
    Row24.Day24.rawValue = Num2Date(dayNum+23,"EEE")
    Row25.Day25.rawValue = Num2Date(dayNum+24,"EEE")
    Row26.Day26.rawValue = Num2Date(dayNum+25,"EEE")
    Row27.Day27.rawValue = Num2Date(dayNum+26,"EEE")
    Row28.Day28.rawValue = Num2Date(dayNum+27,"EEE")
    Row29.Day29.rawValue = Num2Date(dayNum+28,"EEE")
    Row30.Day30.rawValue = Num2Date(dayNum+29,"EEE")
    Row31.Day31.rawValue = Num2Date(dayNum+30,"EEE")
    It still adds the beginning date for the following month if the month selected only has 30 days.  
    I am not sure how to attach the file here for you to see.
    Tracy

  • Time Sheets -  anyone have a template they could share?

    Does any one have a time sheet template they could share. Trying to put together a sheet that can calculate the following:
    IN LUNCH OUT TOTAL
    8am 1 hr 5pm 7
    ANy help would be appreciated.

    I realize this is a year old post but am donating a timesheet I created in case it may be helpful to others. Disclaimer: I am an absolute newcomer to Livescycle designer, but this form is a place to start for others to add features.
    The form uses JavaScript and accepts input from the user for the start date of the 2 week pay period, and then it calculates all the dates for the days of the week. It totals the hours entered and can be printed or emailed.
    The target email address has been left intentionally blank, and will need to be entered manually.
    Hope some find it useful...
    > http://www.davidbartholomew.com/PDF_TimeSheet.pdf
    ---and that Karma returns other kindnesses to me.
    -David

  • Why is my Time Sheet not working on Android Readers?

    I have a Time Sheet with Javascript that adds the times up, and it works perfect with the PC version of Adobe Reader, but when I try to use it on a nexus 7 tablet the calculations don't work.
    I have tried the official Adobe Reader for Android as well as about a dozen other readers.  If there is a reader that will work with this sheet as is, I don't mind paying for it, or perhaps part of my JavaScript is not supported on mobile, and I can change it with a workaround.
    Please Take a look and see what you can see:
    PR_Form_Tablet6.pdf - Google Drive
    Thanks,
    Mike

    Here's a list of what (should) work in Adobe reader:
    http://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/androidapi/index.html
    On Wed, Oct 15, 2014 at 5:32 PM, liquid One <[email protected]>

  • Activity type in time sheet

    Hi all,
    In PS we donu2019t capture any cost. In such case, While entering timesheet, the system through an error message, to enter sender Activity type and it is not allowing to enter timesheet.
    Now, what should be done to skip entering activity type and enter timesheet without entering activity type?
    I guess it is controlled through work center, by not maintaining costing tab, but the system does not allow to save the work center without entering the cost center under costing tab.
    Please suggest, in entering time sheet without activity type
    Thanks,
    Chandru

    Hi,
    Go to --> SPRO --> Cross Application Components --> Time Sheet --> Settings for all User Interfaces --> Time Recording --> Choose Fields -->Data Entry section --> Activity types
    Double click and in reference to data entry profiles we can restrict the entry for the activity type whether it is required / Display / Hide / Input.
    Check and confirm whether the problem is solved
    Regards,
    Selva

  • Error while approving time sheet "Internal Error Occurred"

    1) Time Sheet entry done for an employee b/w 3rd-5th Oct 2011, while approving it through T code - CATS_APPR_LITE, its giving the error " INTERNAL ERROR OCCURRED" !!!
    When the error is expanded, the below details have come up.
    Internal error occurred
    Message no. LR030
    Diagnosis
    The system has detected an internal program error which should not have occurred in a normal program run.
    Procedure
    To safeguard your data, notify the SAP hotline.
    2) Please let us know, is there any other procedure or way to approve the time sheets ???
    Reg,
    Hrishi - 9945607822

    Note 1315885 - CATS: Internal Error(LR030), in transaction CATS_APPR_LITE
    Refer and apply the mentioned note if applicable.
    Regards
    Sreenivas

  • Creation of Time sheet

    I have to create a time sheet as shown below,
                                         2011-10-03      2011-10-04    2011-10-05     2011-10-06    2011-10-07      2011-10-08     2011-10-09
                                           Time                  Time               Time                 TIme               Time                   Time               Time
                                         In    Out  Sign   In   out   Sign  In  Out   Sign    In  Out   Sign   In  Out   Sign    In  Out   Sign   In  Out   Sign
    SNO  Employee Name
    The above format will be taken as print weekly & the users will manually sign the sheet.
    Second & fourth Saturdays column back color should be changed to different color.
    Employee Names will be filled form the database & user input will be week No. The above output is fro week number 40, this year
    Can anyone please help me out who to start this report?

    Well, you do not say if you have a database to work from, so if not, start with excel.
    You can create a fairly simple table  in the example below  DATE is at A1, in A2, Out A3
    first date at B1, Sign in at B2, and Sign Out at B3, etc...
    DATE     IN     OUT
    10/3/2011     Sign In     Sign Out
    10/4/2011     Sign In     Sign Out
    10/5/2011     Sign In     Sign Out
    10/6/2011     Sign In     Sign Out
    10/7/2011     Sign In     Sign Out
    10/8/2011     Sign In     Sign Out
    10/9/2011     Sign In     Sign Out
    10/10/2011     Sign In     Sign Out
    When you build the report in crystal
    go to your data area and add
    DATE
    IN
    OUT
    I below the other.  ( My area is about 1 inch Tall, by 1 inch wide "more on that later )  I am using CR XI, so I hope your instructions will be like these
    Right click in the details section, and select  Format with multiple columns.   At the top right you should see a layout tab now.
    click on the layout tab, select a detail size of 1 inch (or whatever fits on your paper)   also select a printing direction of
    across then down.
    Preview your report,   You can add other columns as needed...   Hope this gives you a good start.

  • Mandatory feilds for PP in time sheet

    Hi ,
    I would like to know what are the mandatory fields in CAT's TIME SHEET for PP.
    Thankds and Regards
    Rambabu E

    Hi,
    Mandatory fields for PP profile in CATS are Work centre, Sender Cost centre, Activity type, Receiving order.
    Regards
    Vijay

  • Dropdown Custom Field in CATS Time Sheet in ESS

    I have added a custom field in CAT2 transaction with drop down values from the custom table.  When I log on to ESS I was not able to see the dropdown in timesheet for that field. I am able to configure the field to have a search help dialog box.
    Let me know how can I configure the field to show dropdown values in time sheet in ESS? Appreciate your replies.
    Thank you,
    Rohit

    check CL_XSS_CAT_VALUE_HELP*
    or
    use implicit enhancement of CL_Xss_cat_value_help_general for the purpose
    build_f4_help Method in the class CL_XSS_CAT_RFC_COMMAND_TOOLS.
    or note 914125 on how to get different helps
    The table TCATS_SHLP_ITS also can be explored

  • Time sheet uploading from Non SAp to SAP R/3.

    Hi,
              I am trying to upload the time sheets from Non SAp to SAP with the datails like the sales oreder for which the employee worked, time spent ect.
              While uploading this from Excel to R/3 using se38, I am gettig an error saying "Enter sender activty also".
              I have checked if the activity type is checked in the CATS data entry profile, it is selected in the defaults.
             I have cheked in KP26, for the year we have given the planned activity also.
             In KSPI, I have run the price alculation for all the cost center with the activity type.
             I have seen the validity periods of the cost centers, activity typs are in line with 2010.
              I am able to upload the time sheets for a few employees and for a few it asks for the "Sender activity type".
              Please assist me, its very urent.
    Regards,
    Shilpa.

    For employees where you are facing this error, please check if Time Sheet defaults - IT0315 is maintained, and if not maintain it.
    Hope this helps.

  • Getting Error in Portal while booking Time Sheet......

    Hi All,
    I am Getting Error in Portal when Booking Time sheet in Record working time Link. Getting below Error.
    "Enter activity type only in conjunction with cost center"...I have entered data in KP26.
    But for the same employee if i am booking the Efforts through R/3 (CAT2 Transaction) not getting the error. Successfully able to release the efforts it is storing in CATSDB.
    PLease advice on this.
    Regards,
    Srinivas...

    Hi Srinivas,
    Please make sure that CATS data entry fields are marked as "input only".
    Regards,
    Dilek

  • Time sheet upload to Service entry sheet

    We have contractors, who works in our project.  They are not on payroll.  We have service PO for them. They are thru some third party vendor.  Vendor gives the Time sheet, and we enter the service entry sheet, make the invoice & do the payment.
    Now the requirement is, that the service entry sheet should be created from Time sheet (third part xls file). Can this be uplaoded to create service entry sheet ??
    Thanks
    amit

    Dear Amit,
    You can use the transaction CAT2, but as far as I know you need to copy / paste teh content from your excel file.
    You may consider using one of the following BAPIs to insert, change or               
    delete CATS data via collective time recording:                                                                               
    BAPI_CATIMESHEETMGR_CHANGE                                                           
    BAPI_CATIMESHEETMGR_DELETE                                                           
    BAPI_CATIMESHEETMGR_INSERT 
    Regards,
    Edit

Maybe you are looking for