Calculating Time

Fyr

Active Member
Joined
Jan 20, 2009
Messages
375
I have a problem when trying to add up time.
I have 4 columns, C, D, E, F.
For example,
HTML:
  C(IN)         D(OUT)          E(IN)           F(OUT)          
7:30 AM        11:30 AM       12:30 PM         4:30 PM

I'm trying to calculate these to display how many hours a worker worked.
In this case, it will be 8 hours. But when trying to calculate this, it doesn't seem to work.
This is what I'm using to calculate. By the way, i'm calculating this from another worksheet.
Code:
=SUM(table!D:D,-table!C:C)+SUM(table!F:F,-table!E:E)

Specifying the actual column and row works, but since there will be more time in the columns, i will be adding/subtracting by column.

thanks for taking a look.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
oops, nevermind, i figured it out.
I needed to calculate the columns first, then add column to column.
This is what I used,

=SUM(table!D:D)-SUM(table!C:C)+SUM(table!F:F)-SUM(table!E:E)
 
Upvote 0
ok, it didn't work after all.
I entered some times, and after row 3, it went back to zero time.

when adding the first row, it came up as 8 hours, when adding the second row in showed as 16 hours. But when adding the third row, it went back to zero.
HTML:
       C(IN)         D(OUT)          E(IN)           F(OUT)          
[1]  7:30 AM        11:30 AM       12:30 PM         4:30 PM
[2]  7:30 AM        11:30 AM       12:30 PM         4:30 PM
[3]  7:30 AM        11:30 AM       12:30 PM         4:30 PM
 
Upvote 0
I tried that, but the calculation is still wrong somehow.
There's just a one row entry with:
HTML:
       C(IN)         D(OUT)          E(IN)           F(OUT)          
[1]  7:30 AM        11:30 AM       12:30 PM         4:30 PM

And on the calcualtion page, it's showing 28:00 when it should be 8:00.
 
Upvote 0

Forum statistics

Threads
1,203,323
Messages
6,054,728
Members
444,747
Latest member
Jaborsum

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