You need to do it like this:

=IF(AND(TIME(0,0,0)<F4,F4<TIME(5,0,0)),"Yes","No")

though you might need to change one of the < to <=

Hope this helps.

Pete