Calculate time from two columns

tezza

Active Member
Joined
Sep 10, 2006
Messages
382
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi all,

I'm trying to calculate the amount of time Col E has start date/time & Col G has end date/time.

This formula works fine until the shift goes past midnight and then I get ###########:

Excel Formula:
=SUM(MOD(G:G,1))-SUM(MOD(E:E,1))

How do I update the code to factor in going past midnight?

Visit Report 2 Sheets.xlsm
EG
107/Jul/2024 20:0007/Jul/2024 22:00
207/Jul/2024 22:0008/Jul/2024 08:00
310/Jul/2024 21:0011/Jul/2024 08:00
411/Jul/2024 08:0011/Jul/2024 09:00
511/Jul/2024 21:0012/Jul/2024 08:00
Go Here
Cell Formulas
RangeFormula
E1:J5E1=FILTER('1000 Rows'!$A:$F,'1000 Rows'!D:D='Go Here'!A1)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E:LExpression=AND($F1<>$F2,$F1<>"")textNO
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I just used G1-E1, then formatted the cells as [h]:mm. The [] shows hours in elapsed time
 
Upvote 0
I just used G1-E1, then formatted the cells as [h]:mm. The [] shows hours in elapsed time
Did you try G5-E5 then calculate the whole columns into just one cell?
 
Upvote 0
No I created a helper column to calc the exact times of each, then summed the totals of the helper column to give me 35 hours
 
Upvote 0
No I created a helper column to calc the exact times of each, then summed the totals of the helper column to give me 35 hours
I managed to solve it:

Excel Formula:
=SUM(VALUE(H:H))-SUM(VALUE(F:F))
 
Upvote 0
Solution

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top