Hi There,
I have a Smartsheet and Form that we use to calculate how long a person was checked into a function to account for down time. Since Smartsheet is not very good with calculating time it took some creativity go get a formula to match up 2 different rows with the same information to calculate the amount of time between them. Here is the formula
=INDEX(COLLECT([Out Time]:[Out Time], Date:Date, @cell = Date@row, Badge:Badge, @cell = Badge@row, Status:Status, @cell = "In"), 1)
The formula works, but a little too good and if the same person checks in and out multiple times in a day, it pulls the original check in time to calculate with the most recent end time. For example, if I check in at 08:05 and check out at 08:15, the formula totals 10 minutes. Now if I go back in the same day at 14:30 and check out at 14:35, it now shows 6 hours and 30 minutes instead of 5 minutes.
I tried adding an ABS function to restrict how far back the formula looks, but it did not return any results. I am not even sure if that is the correct function for this. The added formula looked like this
=INDEX(COLLECT([Out Time]:[Out Time], Date:Date, @cell = Date@row, Badge:Badge, @cell = Badge@row, Status:Status, @cell = "In", ABS([Out Time]@row - @cell) <= TIME(0, 90, 0)), 1)
Is there a way to restrict a formula to look back only 60 minutes so it does not keep adding together these multiple entries?