Time Difference

Maddy1234

New Member
Joined
Mar 9, 2018
Messages
24
Hi experts,

I come with another problem.I have a dynamic set of data which updates according to the user input in another sheet. The data set looks like below.

[TABLE="width: 297"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]


[/TD]
[TD]Time Started[/TD]
[TD]Time Ended[/TD]
[/TR]
[TR]
[TD]Exercise 1[/TD]
[TD="align: right"]9:00[/TD]
[TD="align: right"]9:15[/TD]
[/TR]
[TR]
[TD]Exercise 2[/TD]
[TD="align: right"]9:15[/TD]
[TD="align: right"]10:15[/TD]
[/TR]
[TR]
[TD]Exercise 3[/TD]
[TD="align: right"]10:15[/TD]
[TD="align: right"]11:15[/TD]
[/TR]
[TR]
[TD]Exercise 4[/TD]
[TD="align: right"]11:15[/TD]
[TD="align: right"]12:15[/TD]
[/TR]
[TR]
[TD]Exercise 5[/TD]
[TD="align: right"]12:15[/TD]
[TD="align: right"]13:15[/TD]
[/TR]
[TR]
[TD]Exercise 6[/TD]
[TD="align: right"]13:15[/TD]
[TD="align: right"]14:15[/TD]
[/TR]
[TR]
[TD]Exercise 7[/TD]
[TD="align: right"]14:15[/TD]
[TD="align: right"]15:15[/TD]
[/TR]
[TR]
[TD]Exercise 8[/TD]
[TD="align: right"]15:15[/TD]
[TD="align: right"]16:15[/TD]
[/TR]
[TR]
[TD]Exercise 9[/TD]
[TD="align: right"]16:15[/TD]
[TD="align: right"]17:15[/TD]
[/TR]
[TR]
[TD]Exercise 10[/TD]
[TD="align: right"]17:15[/TD]
[TD="align: right"]18:15[/TD]
[/TR]
</tbody>[/TABLE]

What I want to achieve is the total elapsed time for all the exercises. So ideally I want to get the value MOD((C11-B2),1). But the problem I have is the data set is dynamic and I don't know how many rows Im gonna have so the C11 might change to something else.

Can you please educate me on how to retrieve the last valid row so I can get this to work?

Many 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.
=MOD(LOOKUP(9.99999999E+307,C:C)-B2,1)


Excel 2010
ABCDE
1Time StartedTime Ended
2Exercise 19:009:159:15
3Exercise 29:1510:15
4Exercise 310:1511:15
5Exercise 411:1512:15
6Exercise 512:1513:15
7Exercise 613:1514:15
8Exercise 714:1515:15
9Exercise 815:1516:15
10Exercise 916:1517:15
11Exercise 1017:1518:15
Sheet1
Cell Formulas
RangeFormula
E2=MOD(LOOKUP(9.99999999E+307,C:C)-B2,1)
 
Upvote 0
Thanks mate works perfectly.

=MOD(LOOKUP(9.99999999E+307,C:C)-B2,1)

Excel 2010
ABCDE
Time StartedTime Ended
Exercise 1
Exercise 2
Exercise 3
Exercise 4
Exercise 5
Exercise 6
Exercise 7
Exercise 8
Exercise 9
Exercise 10

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]9:00[/TD]
[TD="align: right"]9:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"]9:15[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]9:15[/TD]
[TD="align: right"]10:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]10:15[/TD]
[TD="align: right"]11:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]

[TD="align: right"]11:15[/TD]
[TD="align: right"]12:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]12:15[/TD]
[TD="align: right"]13:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]13:15[/TD]
[TD="align: right"]14:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]14:15[/TD]
[TD="align: right"]15:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="align: right"]15:15[/TD]
[TD="align: right"]16:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]16:15[/TD]
[TD="align: right"]17:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]

[TD="align: right"]17:15[/TD]
[TD="align: right"]18:15[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E2[/TH]
[TD="align: left"]=MOD(LOOKUP(9.99999999E+307,C:C)-B2,1)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,121
Members
452,381
Latest member
Nova88

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