I need help figuring out why the below formula is not returning the right value. I'm using the formula to determine if trailers are being loaded on time. We use military time for our times and the formula works fine until you reach 00:00. After that everything shows up as late or on time depending on the time. The cells are formatted for time but I still get the same results. In the example you can see that the LRT is 15:30 and Ready Time was 15:00 so trailer was ON TIME. LRT on next one was also 15:30 and Ready Time was 02:36(am) so trailer should've been late but i get on Time. The same for the other two. The last two should both say On Time because they were both done before 00:00 but the 17:30 says late. I've looked but can't seem to find a solution. Any help will be greatly appreciated.


N3 P3 R3
LRT Ready Time Trailer Status

15:30 15:00 ON TIME
15:30 02:36 ON TIME

00:00 17:30 LATE
00:00 23:15 ON TIME

Formula on R3
=IF(P3<=N3,"ON TIME",IF(P3>N3,"LATE"))