Hi all, I'm trying to add more condition to calculate [Overtime].
Ultimately, I want to consider time checked in before 8:10am or checkouts later than 6.50pm as Overtime. However, in the event that both happen then [Overtime] should be SUM of checked time before 8:10am and checkouts later than 6.50pm.
I'm trying to set the formula below, but Appsheet is not accepting it and I'm trying to figure out where went wrong?
IFS(
ISNOTBLANK([Check Out Date Time]), True,
TIME([Check In Date Time]) < "08:10:00", "09:00:00" - TIME([Check In Date Time]),
TIME([Check Out Date Time]) > "18:50:00",TIME([Check Out Date Time]) - "18:00:00",
AND(TIME([Check In Date Time]) < "08:10:00",TIME([Check Out Date Time]) > "18:50:00"),("09:00:00" - TIME([Check In Date Time])) + (TIME([Check Out Date Time]) - "18:00:00")
)
Solved! Go to Solution.
To start with, could you please try if the following works
IFS(
TIME([Check In Date Time]) < "08:10:00", "09:00:00" - TIME([Check In Date Time]),
TIME([Check Out Date Time]) > "18:50:00",TIME([Check Out Date Time]) - "18:00:00",
AND(TIME([Check In Date Time]) < "08:10:00",TIME([Check Out Date Time]) > "18:50:00"),("09:00:00" - TIME([Check In Date Time])) + (TIME([Check Out Date Time]) - "18:00:00")
)
You are welcome and thank you for the update.
I believe you were getting error because the result of the first "condition-value" pair in your expression, that is the part
ISNOTBLANK([Check Out Date Time]), True
was inconsistent with other condition-value pairs. The next three condition-value pairs are evaluating to a "duration" type whereas the first result was evaluating to a TRUE/FALSE which was giving error.
So I suggested an expression without that part. However, you may want to mention why that part was added and we could explore if it is indeed required.
User | Count |
---|---|
18 | |
11 | |
7 | |
3 | |
2 |