TOP
WorkHours function
WORKHOURS() Description
The WORKHOURS() function is designed to count the number of working hours between two given dates, taking into account the working day period and the specified holiday dates.
This function is a powerful tool for calculating working hours, which will facilitate your work with spreadsheets and help you use your time more efficiently. Use it to quickly and accurately determine working hours in your project!
Main Features Functions WORKHOURS
Syntax:
=WORKHOURS(StartDate; EndDate; StartTime; EndTime; [Weekend]; [Holidays]; [WorkingDaysOff])
Parameters:
- StartDate: A cell with the date of the start of work.
- EndDate: Cell with the date of completion of work.
- StartTime: A cell with the start time of the working day.
- EndTime: A cell with the end time of the working day.
- [Weekend]: Optional. A list of weekday numbers of standard weekends in text format (for example, if weekends are Friday and Saturday, then "5,6" is indicated. By default, Saturday and Sunday are used as weekends, that is, the value "6,7". If you specify "-1", then all days will be working days.
- [Holidays]: Optional. A reference to a range with holiday dates that count as weekends in addition to the weekends specified in the previous parameter.
- [WorkingDaysOff]: Optional. A reference to a range of dates that are exceptions to weekends (for example, the shift of working days due to holidays).
Example Usage
Let you have a table with the start and end dates of the calculation period (for example, the start and end of the week, month, quarter, year, etc.), as well as other necessary parameters. You only need to enter the formula WORKHOURS, and LibreOffice Calc will automatically calculate the number of working hours:
=WORKHOURS(StartDate; EndDate; StartTime; EndTime; Weekend; Holidays; WorkingDaysOff)
We will have the following result:
This example uses the following values:
- StartDate: A8 - the starting date of the period.
- EndDate: B8 - the end date of the period.
- StartTime: C8 - the beginning of the working day.
- EndTime: D8 - the end of the working day.
- Weekend: B1 - days of the week that are considered weekends.
- Holidays: B2:B3 - list of holidays.
- WorkingDaysOff: B4:B5 - a list of additional working days.
Download the extension
You can use the WORKHOURS() function by installing the extension "YLC_Utilities.oxt" .
After that, this function will be available in all files that will be opened in LibreOffice Calc.