Getting difference between two cell based on the above cell value and below cell value

knoll126

New Member
Joined
Mar 24, 2015
Messages
23
Office Version
  1. 365
BehEvent

<tbody>
</tbody>
Time

<tbody>
</tbody>
Lobtailing
21:11.2

<tbody>
</tbody>
Blow
21:33.6

<tbody>
</tbody>
Blow
22:21.7

<tbody>
</tbody>
Blow
22:36.3

<tbody>
</tbody>
Lobtailing
23:26.5

<tbody>
</tbody>
Lobtailing
23:30.6

<tbody>
</tbody>
Blow
24:07.6

<tbody>
</tbody>
Blow
24:29.8

<tbody>
</tbody>
Fluke Up Dive
24:50.9

<tbody>
</tbody>

<tbody>
</tbody>

I would like help trying to create a formula to subtract the difference in time between the first blow and the last blow of the same sequence. So between Lobtailing and Lobtailing and between Lobtailing and Fluke Up Dive. So getting the difference between 21:33.6 - 22:36.3 and 24:07.6 - 24:29.8. Any ideas?

Thanks.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,

Don't know how you might want your layout to look like, but here's one way, shown with or without the words "Time interval is:", which you can change to say anything you want.


Excel 2010
ABC
1BehEventTime
2Lobtailing21:11.2 
3Blow21:33.621:33.6
4Blow22:21.7
5Blow22:36.3Time interval is: 01.02.7
6Lobtailing23:26.5
7Lobtailing23:30.6
8Blow24:07.624:07.6
9Blow24:29.8Time interval is: 00.22.2
10Fluke Up Dive24:50.9
Sheet1
Cell Formulas
RangeFormula
C2=IF(AND(A2="Blow",OR(A1={"Lobtailing","Fluke Up Dive"})),B2,IF(AND(A2="Blow",OR(A3={"Lobtailing","Fluke Up Dive"})),"Time interval is: "&TEXT(B2-LOOKUP(9.99999999999999E+307,C1:C$2),"mm.ss.0"),""))



Excel 2010
ABC
1BehEventTime
2Lobtailing21:11.2 
3Blow21:33.621:33.6
4Blow22:21.7
5Blow22:36.301:02.7
6Lobtailing23:26.5
7Lobtailing23:30.6
8Blow24:07.624:07.6
9Blow24:29.800:22.2
10Fluke Up Dive24:50.9
Sheet2
Cell Formulas
RangeFormula
C2=IF(AND(A2="Blow",OR(A1={"Lobtailing","Fluke Up Dive"})),B2,IF(AND(A2="Blow",OR(A3={"Lobtailing","Fluke Up Dive"})),B2-LOOKUP(9.99999999999999E+307,C1:C$2),""))


C2 formula copied down.
 
Upvote 0
And here's a solution using a helper column (in column C).

I'm assuming all cell references are the same as in post #4 .

The helper column can be hidden if required.

In C2
=IF(AND(A2="Blow",A1<>"Blow"),B2,IF(AND(A2="Blow",A1="Blow"),C1,0))

In D2
=IF(AND(A2="Blow",A3<>"Blow"),B2-C2,"")

And copy both down as far as required.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,793
Members
451,589
Latest member
Harold14

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