A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hello vitaliy dshaun,
The REDUCE function can be used to process and accumulate multiple time entries. However, when the same formula also needs to account for unpaid breaks, overtime, overnight shifts, and missing clock-in or clock-out entries, it can become difficult to read and maintain.
Based on your description, I created a simple example using one row for each clock-in and clock-out pair. The worked time is calculated in a separate column with the following formula:
=IF(OR(C5="",D5=""),"",MOD(D5-C5,1)-IF(E5="",0,E5))
In simple terms:
-
OR(C5="",D5="")checks whether the Clock In or Clock Out cell is blank. -
""returns a blank result when one of the time entries is missing. -
MOD(D5-C5,1)calculates the time between Clock In and Clock Out and also supports shifts that continue past midnight. -
IF(E5="",0,E5)treats a blank Unpaid Break cell as zero; otherwise, it subtracts the entered break time.
For overtime above eight hours, the example uses:
=IF(F5="","",MAX(0,F5-TIME(8,0,0)))
A separate status column can also identify missing entries:
=IF(OR(C5="",D5=""),"Missing time entry","OK")
After calculating each row, the total hours for an employee can be added with SUMIFS, for example:
=SUMIFS($F$5:$F$10,$A$5:$A$10,J5)
This approach separates each part of the calculation, making it easier to review and update than placing all the rules inside one REDUCE formula.
You may review the attached example and adapt the formulas to your worksheet. Please note that this is a general example based on the description provided. The exact formulas may need to be adjusted depending on your table structure and overtime rules.
Best regards,
If the answer is helpful, please click "Yes". If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in documentation to enable e-mail notifications if you want to receive the related email notification for this thread.