Excel how get number of hours in a time interval? -


i have 2 columns with:

night shift start: 19:00  night end: 04:00 

and have date columns each day..

work started: 07:30  worked ended: 22:00 

i want number of hours decimal between night shift start , night end. need calculate number of "night shift hours" worked hours.

from comment: not want total number of hours. want calculate number of "night shift hours" , hours between 19:00-04:00

=if(b1-a1 < 0, 1-(a1-b1),( b1-a1)) 

assuming cell a1 contains start, b1 contains end time.
let me know, if helps or errors.

time without date not enough subtraction considering start can night before today.

are ok try vba?

edit: formula meaningful within 12 hour limit. see if can made simpler.


Comments