Home > Back-end >  How to get time elapsed till 12:00 AM in same day and rest on next day
How to get time elapsed till 12:00 AM in same day and rest on next day

Time:05-28

I am currently facing difficulty to calculate exact hours between In Time and Out time.

for instance :

Column A Column B Column C Column D
1-1-2022 10:00 PM 1-2-2022 6:00 AM
1-2-2022 10:00 PM 1-3-2022 6:00 AM

Now, my problem is that I have to calculate the time from 10:00 PM till 12:00 AM = 4 Hours and rest to be calculated on the next day adding the previous days hours e.g. we have 6 hours from 12:00 AM till 6:00 AM for 1-2-2022 (Column C) and then 2 hours from 10:00 PM to 12:00 AM.

Looking forward your help.

CodePudding user response:

You must add the date and times together, subtracting the In time from the Out time.

enter image description here

CodePudding user response:

Slightly different method:

enter image description here

B2, D2 and E2 formatted as hh:mm

Then you could use mod() like so:

=MOD(D2-B2,1)
  • Related