I am doing some value stream mapping at work and I'm trying to track how long it takes for certain tasks to complete.

At first I was just entering a start time/date in A1 and end time/date in B1, then =B1-A1 in C1.
This works fine, but some things sit over night and I don't want the time included where nobody is at work.

For example 1st shift is from 6:00am-2:00pm and 2nd shift is from 2:00pm-12am, nobody works from 12:00am to 6am. I want to enter a Start time at 8:00pm and End time at 8:00am and get excell to exclude the time between 12:00am and 6:00am, so the value I get is 6 hours instead of 12 hours.

I hope I explained this well enough, any help would be greatly appreciated.