Try these, in L2 and M2 dragged down, for your Tardy and Leave Early columns:
Formula:
=IF(C2="","",IF(C2-INT(C2)<=6/24,"n/a",IF(C2-INT(C2)>=6/24+1/24,0.5,0.25)))
Formula:
=IF(D2="","",IF(D2-INT(D2)>=16.5/24,"n/a",IF(D2-INT(D2)<=16.5/24-1/24,0.5,0.25)))
They will return blank if there is no date/time in columns C / D. That's the first part of each formula, in blue.
If there is a date/time, they will return 'n/a' if the clock-in time is before/at 6am / the clock-out time is at/after 4:30pm. 6am is 6/24, 4:30pm is 16.5/24. That's the second part of each formula, in green.
If the time is more than/equal to one hour before 6am / after 4:30pm, they will return 0.5. That's the third parts, in red.
If none of those conditions are met, the only possibility is that the time is within an hour of 6am / 4:30pm, so the result is 0.25. That's the last parts, in black.
There's one problem with the formulae - they don't account for someone leaving work and coming back on the same day. For example, on rows 144 and 145 of your sample file, the worker clocks-out at 4:31pm then clocks-in again at 4:32pm. The formula generates a 'tardy' of 0.5 for this second clock-in. Similarly on rows 167/168 there are both a 'leave early' 0.5 and 'tardy' 0.5 generated. It would be possible to amend the formula to look for just the first clock-in / last clock-out of each day, but it will make it a bit messier, so do you want that, or are you happy with it like this? If the latter, you could add some Conditional Formatting to highlight when there are two or more clock-ins/outs on one day.
Does that help?
Bookmarks