Using MOD here is a simple way to cope with time periods passing through midnight.

I assume you have your result cell custom formatted as [m] - if you format as general you'll see 300....or if you want to leave the cell formatted as [m] then take out the multiplication by 1440, i.e. use

=IF(MOD(F5-E5+"2:00",1)-"2:00">0,MOD(F5-E5,1),0)