## How to calculate worked night hours automatically

14/03/2021

Calculating the hours worked per day is easy with any spreadsheet, just subtract the departure time from the arrival time (a formula like B1-A1). On the other hand, the calculation of the hours worked at night is much more complex, several calculations and different cases must be managed: arrival before midnight and departure before midnight, arrival and departure before or during the beginning of night hours. , the night period which may vary …

Planningify® offers a new night time calculator for users of the full version, which is easy to configure and use, and can also be used to determine day hours and salary bonuses.

Depending on the company, the employment contract and the collective collection, it will therefore be possible to automatically determine the additional salary, the recovery hours obtained through night work, and also to see if the maximum number of maximum night hours at not to exceed is respected by the employer.

Use case 1: Calculate the number of hours worked between 9 p.m. and 6 a.m.
Go to “Schedule options”, “Calculated columns”
Write the following information:

• Title: Night
• Formula: DURATION_INTERVAL(#ARRIVAL1#, #DEPARTURE1#, 21 * 60, 06 * 60) + DURATION_INTERVAL(#ARRIVAL2#, #DEPARTURE2#, 21 * 60, 06 * 60)
• Type: Number
• The number of hours is displayed in minutes, for example 130 minutes, in a future version it will be possible to use the time format, for example 02:10)
• Formula type: “Days”

To view the results, you must then go to Menu, Reports then “Week with comments”, “Month with comments” or “Year”.

Use case 2: Calculation of income with an hourly wage of 12.50\$ and an increase of 25% for night hours

• Title: Salary
• Formula: 12.50 * (#DURATION# + 0.25 * (DURATION_INTERVAL(#ARRIVAL1#, #DEPARTURE1#, 21 * 60, 06 * 60)) + DURATION_INTERVAL (#ARRIVAL2#, #DEPARTURE2#, 21 * 60, 06 * 60) )
• Type: Number