View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
kmariab kmariab is offline
external usenet poster
 
Posts: 6
Default military time "if" formula

Thanks for your help. I tried the formula, but it doesn't seem to work for
overnight shifts.

"MyVeryOwnSelf" wrote:

i have employees sign-in and sign-out using military time. I want to
be able
to calculate if each employee was present at a certain hour. For
example: Sign-in: 8:00
Sign-out: 14:00
Was employee present at 9:00? Yes
Was employee present at 13:00? No

My problem arises when employee works overnight. For example:
Sign-in: 18:00
Sign-out: 3:00

Is there a formula that recognizes whether employee was present
between those times?


With the Sign-in time in B13, Sign-out time in B14 and the Test time
in B15 ...


Maybe something like this would work for you:

=IF(B14<B13,IF(OR(B15=B13,B15<=B14),"Yes","No"),
IF(AND(B15B13,B15<B14),"Yes","No"))

Of course, this doesn't work if somebody stays for more than 24 hours.