If statement

bboysen

New Member
Joined
Aug 6, 2010
Messages
44
Ok all i have killed the brain today on this one and can not find anything out there on the internet that i can understand what they are trying to do and how they are coming up with solutions.

This is what i have:
A1 B1
Station Code
1220286.65 XR
1220329.70 XOB
1220342.40 XR
1220386.33 XSAG
1220403.54 XR
1220407.01 XER

OK so what i am trying to do is have an if statement that i will find the the first XR code and then find the next XR code then - the Station of them two codes to come up with a distance (first on is 44.25) all in a different cell. Is this possible with out VBA?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I used your data but got a different result as i don't think that in your example that the numbers are correct. I think that XR 1 - XR 2 = 55.75 not 44.25:


put this in cell c2
=INDEX(A2:B7,MATCH(B2,B2:B7,ROW(A2:A7)),1)-A2
 
Upvote 0
You are right on the total like i said my brain is fried with this today.

That work great for the areas when i do not have XR next to its self and i do apologize for not including more info. In some areas i have them right next to each other.

Like this

A B
Station Code
1220104.00 XR
1220165.05 XR
1220225.69 XR
1220286.65 XR
1220329.70 XOB
1220342.40 XR
1220386.33 XSAG
1220403.54 XR
1220407.01 XER
1220415.19 XRD
1220426.60 XER
1220445.34 XSAG
1220459.77 XCDW
1220460.73 XCDW
1220464.11 XR

Thanks for all of your help!
 
Upvote 0
You are right on the total like i said my brain is fried with this today.

That work great for the areas when i do not have XR next to its self and i do apologize for not including more info. In some areas i have them right next to each other.

Like this

A B
Station Code
1220104.00 XR
1220165.05 XR
1220225.69 XR
1220286.65 XR
1220329.70 XOB
1220342.40 XR
1220386.33 XSAG
1220403.54 XR
1220407.01 XER
1220415.19 XRD
1220426.60 XER
1220445.34 XSAG
1220459.77 XCDW
1220460.73 XCDW
1220464.11 XR

Thanks for all of your help!
Try this...

Book1
ABCD
1StationCodeCodeDifference
21220104.00XRXR61.05
31220165.05XR__
41220225.69XR__
51220286.65XR__
61220329.70XOB__
71220342.40XR__
81220386.33XSAG__
91220403.54XR__
101220407.01XER__
111220415.19XRD__
121220426.60XER__
131220445.34XSAG__
141220459.77XCDW__
151220460.73XCDW__
161220464.11XR__
Sheet1

Array formula** entered in D2:

=INDEX(A:A,SMALL(IF(B2:B16=C2,ROW(B2:B16)),2))-INDEX(A:A,MATCH(C2,B:B,0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Try this...

Sheet1

A B C D
1 Station Code Code Difference
2 1220104.00 XR XR 61.05
3 1220165.05 XR _ _
4 1220225.69 XR _ _
5 1220286.65 XR _ _
6 1220329.70 XOB _ _
7 1220342.40 XR _ _
8 1220386.33 XSAG _ _
9 1220403.54 XR _ _
10 1220407.01 XER _ _
11 1220415.19 XRD _ _
12 1220426.60 XER _ _
13 1220445.34 XSAG _ _
14 1220459.77 XCDW _ _
15 1220460.73 XCDW _ _
16 1220464.11 XR _ _



Array formula** entered in D2:

=INDEX(A:A,SMALL(IF(B2:B16=C2,ROW(B2:B16)),2))-INDEX(A:A,MATCH(C2,B:B,0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
So this is what i am getting!


<b>Sheet1</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:88px;" /><col style="width:88px;" /><col style="width:175px;" /><col style="width:173px;" /><col style="width:88px;" /><col style="width:88px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="text-align:center; ">Station</td><td style="text-align:center; ">Code</td><td style="text-align:center; ">Code</td><td style="text-align:center; ">Difference with Formaula</td><td >*</td><td style="text-align:center; ">Real Difference</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="text-align:center; ">1220225.686</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">60.96368042</td><td >*</td><td style="text-align:center; ">-60.96368042</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="text-align:center; ">1220286.65</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">116.7105735</td><td >*</td><td style="text-align:center; ">-55.74689307</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="text-align:center; ">1220329.702</td><td style="text-align:center; ">XOB</td><td style="text-align:center; ">XOB</td><td style="font-family:Verdana; text-align:center; ">176.8239859</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="text-align:center; ">1220342.397</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">177.854252</td><td >*</td><td style="text-align:center; ">-61.14367851</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="text-align:center; ">1220386.33</td><td style="text-align:center; ">XSAG</td><td style="text-align:center; ">XSAG</td><td style="font-family:Verdana; text-align:center; ">59.01305492</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="text-align:center; ">1220403.54</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">238.419954</td><td >*</td><td style="text-align:center; ">-60.56570204</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="text-align:center; ">1220407.011</td><td style="text-align:center; ">XER</td><td style="text-align:center; ">XER</td><td style="font-family:Verdana; text-align:center; ">19.59009842</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td style="text-align:center; ">1220415.186</td><td style="text-align:center; ">XRD</td><td style="text-align:center; ">XRD</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td style="text-align:center; ">1220426.601</td><td style="text-align:center; ">XER</td><td style="text-align:center; ">XER</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td style="text-align:center; ">1220445.343</td><td style="text-align:center; ">XSAG</td><td style="text-align:center; ">XSAG</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td style="text-align:center; ">1220459.774</td><td style="text-align:center; ">XCDW</td><td style="text-align:center; ">XCDW</td><td style="font-family:Verdana; text-align:center; ">0.95721941</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td style="text-align:center; ">1220460.731</td><td style="text-align:center; ">XCDW</td><td style="text-align:center; ">XCDW</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td style="text-align:center; ">1220464.106</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">287.1153245</td><td >*</td><td style="text-align:center; ">-48.69537047</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td style="text-align:center; ">1220506.526</td><td style="text-align:center; ">XOB</td><td style="text-align:center; ">XOB</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >16</td><td style="text-align:center; ">1220512.802</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; text-align:center; ">347.5717253</td><td >*</td><td style="text-align:center; ">-60.45640083</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >17</td><td style="text-align:center; ">1220573.258</td><td style="text-align:center; ">XR</td><td style="text-align:center; ">XR</td><td style="font-family:Verdana; ">#NUM!</td><td >*</td><td >*</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "></table>

I might be going about this all wrong and maybe need to do some vba. What do you all think?
 
Upvote 0
So this is what i am getting!


Sheet1

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 88px"><COL style="WIDTH: 88px"><COL style="WIDTH: 175px"><COL style="WIDTH: 173px"><COL style="WIDTH: 88px"><COL style="WIDTH: 88px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD>*</TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: center">Station</TD><TD style="TEXT-ALIGN: center">Code</TD><TD style="TEXT-ALIGN: center">Code</TD><TD style="TEXT-ALIGN: center">Difference with Formaula</TD><TD>*</TD><TD style="TEXT-ALIGN: center">Real Difference</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: center">1220225.686</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">60.96368042</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-60.96368042</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: center">1220286.65</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">116.7105735</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-55.74689307</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: center">1220329.702</TD><TD style="TEXT-ALIGN: center">XOB</TD><TD style="TEXT-ALIGN: center">XOB</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">176.8239859</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: center">1220342.397</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">177.854252</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-61.14367851</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: center">1220386.33</TD><TD style="TEXT-ALIGN: center">XSAG</TD><TD style="TEXT-ALIGN: center">XSAG</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">59.01305492</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: center">1220403.54</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">238.419954</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-60.56570204</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: center">1220407.011</TD><TD style="TEXT-ALIGN: center">XER</TD><TD style="TEXT-ALIGN: center">XER</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">19.59009842</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: center">1220415.186</TD><TD style="TEXT-ALIGN: center">XRD</TD><TD style="TEXT-ALIGN: center">XRD</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">10</TD><TD style="TEXT-ALIGN: center">1220426.601</TD><TD style="TEXT-ALIGN: center">XER</TD><TD style="TEXT-ALIGN: center">XER</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: center">1220445.343</TD><TD style="TEXT-ALIGN: center">XSAG</TD><TD style="TEXT-ALIGN: center">XSAG</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">12</TD><TD style="TEXT-ALIGN: center">1220459.774</TD><TD style="TEXT-ALIGN: center">XCDW</TD><TD style="TEXT-ALIGN: center">XCDW</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">0.95721941</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">13</TD><TD style="TEXT-ALIGN: center">1220460.731</TD><TD style="TEXT-ALIGN: center">XCDW</TD><TD style="TEXT-ALIGN: center">XCDW</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">14</TD><TD style="TEXT-ALIGN: center">1220464.106</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">287.1153245</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-48.69537047</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">15</TD><TD style="TEXT-ALIGN: center">1220506.526</TD><TD style="TEXT-ALIGN: center">XOB</TD><TD style="TEXT-ALIGN: center">XOB</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">16</TD><TD style="TEXT-ALIGN: center">1220512.802</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: center">347.5717253</TD><TD>*</TD><TD style="TEXT-ALIGN: center">-60.45640083</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">17</TD><TD style="TEXT-ALIGN: center">1220573.258</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="TEXT-ALIGN: center">XR</TD><TD style="FONT-FAMILY: Verdana">#NUM!</TD><TD>*</TD><TD>*</TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY></TBODY></TABLE>

I might be going about this all wrong and maybe need to do some vba. What do you all think?
The formula I suggested is for finding the difference between the 1st and 2nd instance of some code. Like: 2nd instance minus 1st instance.

It looks like you want the opposite: 1st instance minus 2nd instance. And then, you want nth instance minus nth instance +1.

Can you sort the data so that all the code types will be grouped together?
 
Upvote 0
Biff thanks for the quick reply.

I can sort it to any order but the problem with that the station is a formula that is derived from another cell.

Here is what I have in the bigger picture:


Excel Workbook
ABCDEFGHIJKLMNO
1MP2d Station3d StationPoint NoNorthingEastingElevationCode2d Distance3d DistanceDelta ElevationWeld No.Pipe / Serial No.Heat No.Cover
2216.6512198+00.0012198+00.0055000113944005.3181047205.8035077.579XLE****5GC1750T45936B*
3216.6612198+60.5212198+60.5255000213943948.1811047185.8675077.163XR60.5260.52-0.42AML16395GC1751T45895B3.9
4216.6812199+21.4912199+21.5055000313943890.9591047164.8005077.804XR60.9860.980.64AML16405GC1752T458953.9
5216.6912199+82.4412199+82.4455000413943833.5901047144.2305077.810XR60.9560.950.01AML16415GC1753T45936B3.8
6216.7012200+43.0912200+43.1155000513943776.5731047123.5585079.151XR60.6560.661.34AML16425GC1754T458953.8
7216.7112201+03.9712201+04.0055000613943719.3731047102.6875080.044XR60.8960.900.89AML16435GC1755T458953.9
8216.7212201+65.0212201+65.0555000713943662.0251047081.7735080.563XR61.0461.040.52AML16445GC1756T45936B3.8
9216.7312202+25.6612202+25.6955000813943604.9581047061.2645080.431XR60.6460.64-0.13AML16455GC1757T45936A4.2
10216.7412202+86.6112202+86.6555000913943547.5091047040.8915079.371XR60.9560.96-1.06AML16465GC1758T458954.2
11216.7512203+29.6612203+29.7050000113943507.0981047026.0465079.095XOB43.0543.05-0.28***4.2
12216.7612203+42.3612203+42.4050000213943495.0481047022.0535079.014XR12.6912.69-0.08CTI1465GC1760T458954.3
13216.7612203+86.2912203+86.3350000313943453.8411047006.8295078.442XSAG43.9343.93-0.57***5.2
14216.7712204+03.5012204+03.5450000413943437.6231047001.0765078.733XR17.2117.210.29AML16475GC1762T45936B5.1
15216.7712204+06.9612204+07.0150000513943434.3821046999.8405078.850XER3.473.470.12***5.1
16216.7712204+15.1412204+15.1950000613943426.6601046997.1605079.006XRD8.178.180.16****
17216.7712204+26.5512204+26.6050000713943415.9331046993.2595079.109XER11.4111.410.10***5
18216.7712204+45.2912204+45.3450000813943398.2631046987.0275079.538XSAG18.7418.740.43***5
19216.7812204+59.7112204+59.7750001413943384.7341046982.0415080.141XCDW14.4214.430.60****
20216.7812204+60.6612204+60.7350001513943383.8411046981.6975080.163XCDW0.960.960.02****
21216.7812204+64.0312204+64.1150000913943380.5541046980.9575080.358XR3.373.370.20CTI1475GC1759T45936B5.1
Spread 5 North End Master


As you can see i have a ton for formulas in this spread sheet and this is only the beginning. The Code "XR" will some times have 1-10 row between the two different "XR" shots ones.

I do not know if this makes any sense to you but it is kind of hard to explain. Thanks for all of your :help:.
 
Upvote 0
Biff thanks for the quick reply.

I can sort it to any order but the problem with that the station is a formula that is derived from another cell.

Here is what I have in the bigger picture:


Excel Workbook
ABCDEFGHIJKLMNO
1MP2d Station3d StationPoint NoNorthingEastingElevationCode2d Distance3d DistanceDelta ElevationWeld No.Pipe / Serial No.Heat No.Cover
2216.6512198+00.0012198+00.0055000113944005.3181047205.8035077.579XLE****5GC1750T45936B*
3216.6612198+60.5212198+60.5255000213943948.1811047185.8675077.163XR60.5260.52-0.42AML16395GC1751T45895B3.9
4216.6812199+21.4912199+21.5055000313943890.9591047164.8005077.804XR60.9860.980.64AML16405GC1752T458953.9
5216.6912199+82.4412199+82.4455000413943833.5901047144.2305077.810XR60.9560.950.01AML16415GC1753T45936B3.8
6216.7012200+43.0912200+43.1155000513943776.5731047123.5585079.151XR60.6560.661.34AML16425GC1754T458953.8
7216.7112201+03.9712201+04.0055000613943719.3731047102.6875080.044XR60.8960.900.89AML16435GC1755T458953.9
8216.7212201+65.0212201+65.0555000713943662.0251047081.7735080.563XR61.0461.040.52AML16445GC1756T45936B3.8
9216.7312202+25.6612202+25.6955000813943604.9581047061.2645080.431XR60.6460.64-0.13AML16455GC1757T45936A4.2
10216.7412202+86.6112202+86.6555000913943547.5091047040.8915079.371XR60.9560.96-1.06AML16465GC1758T458954.2
11216.7512203+29.6612203+29.7050000113943507.0981047026.0465079.095XOB43.0543.05-0.28***4.2
12216.7612203+42.3612203+42.4050000213943495.0481047022.0535079.014XR12.6912.69-0.08CTI1465GC1760T458954.3
13216.7612203+86.2912203+86.3350000313943453.8411047006.8295078.442XSAG43.9343.93-0.57***5.2
14216.7712204+03.5012204+03.5450000413943437.6231047001.0765078.733XR17.2117.210.29AML16475GC1762T45936B5.1
15216.7712204+06.9612204+07.0150000513943434.3821046999.8405078.850XER3.473.470.12***5.1
16216.7712204+15.1412204+15.1950000613943426.6601046997.1605079.006XRD8.178.180.16****
17216.7712204+26.5512204+26.6050000713943415.9331046993.2595079.109XER11.4111.410.10***5
18216.7712204+45.2912204+45.3450000813943398.2631046987.0275079.538XSAG18.7418.740.43***5
19216.7812204+59.7112204+59.7750001413943384.7341046982.0415080.141XCDW14.4214.430.60****
20216.7812204+60.6612204+60.7350001513943383.8411046981.6975080.163XCDW0.960.960.02****
21216.7812204+64.0312204+64.1150000913943380.5541046980.9575080.358XR3.373.370.20CTI1475GC1759T45936B5.1
Spread 5 North End Master


As you can see i have a ton for formulas in this spread sheet and this is only the beginning. The Code "XR" will some times have 1-10 row between the two different "XR" shots ones.

I do not know if this makes any sense to you but it is kind of hard to explain. Thanks for all of your :help:.
Based on the data in post #5 it looks like this station value is in ascending order.

Is that always the case?
 
Last edited:
Upvote 0
Yes the station is always in ascending order and is calc off of the 2d distance and the 3d distance plus the Cell above it.

Thanks of your help!
 
Upvote 0
Yes the station is always in ascending order and is calc off of the 2d distance and the 3d distance plus the Cell above it.

Thanks of your help!
OK I think I have it.

Book1
ABC
21220225.686XR-60.964
31220286.650XR-55.747
41220329.702XOB
51220342.397XR-61.143
61220386.33XSAG
71220403.540XR-60.566
81220407.011XER
91220415.186XRD
101220426.601XER
111220445.343XSAG
121220459.774XCDW
131220460.731XCDW
141220464.106XR-48.696
151220506.526XOB
161220512.802XR-60.456
171220573.258XR
Sheet1

This array formula** entered in C2 and copied down:

=IF(B2="xr",IF(A2=INDEX(A$2:A$17,MATCH(1E100,IF(B$2:B$17="xr",A$2:A$17))),"",A2-INDEX(A3:A$17,MATCH("xr",B3:B$17,0))),"")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,287
Members
452,902
Latest member
Knuddeluff

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