Hi ,
See the attached file.
The first formula in cell G2 is : =IF((D2-C2)>TIMEVALUE("00:03:00"),"VALID","INVALID")
The other cells have a different formula , which is :
=IF(E3 < TIMEVALUE("00:03:00"),"INVALID",IF(A3=A2,IF(B3=B2,IF(C3<D2,"INVALID","VALID"),"VALID"),"VALID"))
Enter this in G3 and copy down.
Narayan