Work with dates
Work out hours between two times
=(B2-A2)*24How it works in Excel
- B2-A2 gives the gap as part of a day.
- Multiplying by 24 turns that into hours.
- Format the cell as Number, not Time.
- For shifts past midnight, use =MOD(B2-A2,1)*24.
The idea in general
Excel treats a full day as the number 1, so 12 hours is 0.5.
What I assumed
- The start time is in A2 and the end time is in B2.
Check the result on your own data before relying on it.