Calculating total time

odrisso

New Member
Joined
Oct 15, 2014
Messages
11
Hi,

I have two columns like this way.

a102
a135
a157
b189
b201
a222
a245
b290

<tbody>
</tbody>

Here the values are in seconds. I want to write a formula, which show the total duration of seconds of a and b.

For example: here total duration of a is = (157-102) + (245-222) = 78 seconds.

Please suggest me how to do it.

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I want to write a formula, which show the total duration of seconds of a and b. For example: here total duration of a is = (157-102) + (245-222) = 78 seconds.

I would structure a table as follows.


A
B
C
D
1


a
b
2
total
7812
3
a102-102
4
a1350
5
a157157
6
b189
-189
7
b201
201
8
a222-222
9
a245245
10
b290
0

<tbody>
</tbody>

Formulas:
C2: =SUM(C3:C10)
C3: =IF($A3=C$1,IF($A3<>$A2,-$B3*($A3=$A4),IF($A3<>$A4,$B3,0)),"")

Copy C2 and paste into D2.

Copy C3 and paste into C3:D10

Note that D10 is zero because there is no end-time to subtract B10 from. I presume that is what you want, based on your example.

If not, explain how the duration should be calculated in that case, if you need help to modify the formula column D.
 
Upvote 0
Hi, yess..Thanks a lot. It works..

I have Another query. I have the following table:

SN'Stage 2'
SN'Stage 2'
Ex'Stage 2'
SN'Stage 2'
Ex'Stage 2'
SN'Stage 2'
SN'Stage 2'
Ex'Stage 2'
SN'Stage 2'
Ex'Stage 2'
SN'Stage 2'
SN'Stage 2'
SN'Stage 2'

<colgroup><col><col><col></colgroup><tbody>
</tbody>

Now, I want to delete the 'Stage 2' from 2nd coloumn where there is an Ex.

Please kindly let me know how to do it. Thanks again
 
Upvote 0
I made a mistake..

I have three columns like this way.

a102103
a135136
a157160
b189191
b201202
a222223
a245250
b290292

<tbody>
</tbody>


Here the values are in seconds. I want to write a formula, which show the total duration of seconds of a and b.

For example: here total duration of a is = (160-102) + (250-222) = 86 seconds.

Please suggest me how to do it.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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