Formula to measure length of pipeline within specific depth brackets

WaltKerkmeer

New Member
Joined
Jan 13, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am struggling with a formula on Excel and was hoping you could help me with this. I work for a construction company and one of the things we do is the installation of manholes and pipelines.

We get paid a rate for pipelines between 0 and 1.5 meters deep. Then there is a separate rate for pipelines between 1.51 and 3 meters deep, then 3.01 to 4.5 meters deep and so forth.

I would like Excel to calculate how many meters of pipe are in the 0-1.5m, 1.51-3m and 3.01-4.5m brackets. At the moment I’m manually calculating this for each pipeline which is time consuming. An example below:

Known values:
Manhole A: 3.4m deep
Manhole B: 2.2m deep
Pipeline length: 28 meters

This falls in the 1.51-3m and 3.01-4.5m brackets.

3.4 – 3 = 0.4

3 – 2.2 = 0.8

0.4 + 0.8 = 1.2

0.4 / 1.2 = 0.33

0.33 * 28 = 9.24

So 9.24 meters of pipe is between 3.01-4.5m deep and the remaining length of pipe will be 1.51-3m deep. As you can imagine, it gets even worse when there’s a pipeline starting at say 1.2m deep and finishing at 4.3m deep, as in that situation the result would be in 3 different depth brackets (0-1.5m, 1.51-3m and 3.01-4.5m).

If there is anyone who could produce the formula to work this out, I would be forever grateful. This will save me a tonne of time.

Thanks in advance!
 
That didn't work for some reason, this is the link:

1580336447293.png
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I'll play around a bit and see what I can come up with. In the meantime, =PRODUCT(H94,J94)+H94 can be written as:

=(J94+1)*H94
 
Upvote 0
I tried downloading the spreadsheet, but it didn't help much. It was set to View only, so I could see the data, but not the formulas. Can you try using the XL2BB tool to show a sample of your sheet? I suspect it would be easiest to add some helper columns, but I can't tell for sure until I can see how the values are calculated.
 
Upvote 0
Hi Eric,

Please see below, hope this works:

Book1
ABCDEFGHIJKMNOPSTUV
1Manhole Name/Pipe size (mm)MH Size (mm)/Pipe ClassCoord. NCoord. EX dist.Y dist.Calculated Line Length (flat)Calculated Line Length (actual)Calculated Gradient (%)Cement Treated Bedding/ Anchor BlockLid Level RL Pipe Inlet RLPipe Outlet RLMH Depth to Invert (m)0-1.5m depth pipe1.5-3m depth pipe3-4.5m depth pipe4.5-6m depth pipe
21.53.04.56.0
3Upstream MHSWMH 48.110505950715.21749635.1373.6872.371.31
41st Line225Class 417.84-10.5920.723.2812.2%CTB4.7018.570.000.00
52nd MHSWMH 48.210505950697.361749624.5472.0369.8469.782.25
62nd Line300Class 47.99-7.5711.011.343.0%None0.0011.340.000.00
73rd MHSWMH 48.310505950689.371749616.977169.4569.31.7
83rd LineClass 4None
94th MHSWMH L2/7
10
11Upstream MHSWMH 47A10505950737.271749647.774.3673.061.3
121st Line375Class 2-45.1422.8150.652.303.4%None45.476.820.000.00
132nd MHSWMH 4710505950782.411749670.5172.8171.3471.281.53
142nd Line375Class 2-15.757.4817.418.023.3%None7.2110.810.000.00
153rd MHSWMH 15.310505950798.161749677.9972.0870.770.61.48
163rd Line375Class 2-49.2311.6750.653.225.2%None7.6045.620.000.00
174th MHSWMH 15.210505950847.391749689.6669.5467.9767.921.62
184th Line375Class 2-24.0410.0726.127.736.4%None0.0027.730.000.00
195th MHSWMH 1510505950871.431749699.7367.8466.2566.211.63
205th Line375Class 2-31.3822.9838.941.867.6%None17.1324.740.000.00
216th MHSWMH 14.110505950902.811749722.7164.663.2463.191.41
226th Line450Class 2-17.32919.522.7916.8%CTB1.6421.150.000.00
237th MHSWMH 1410505950920.131749731.7162.5359.9259.872.66
247th Line525Class 213.4737.5939.940.531.5%None0.0040.530.000.00
258th MHSWMH 1610505950906.661749769.360.9359.2759.131.8
268th Line525Class 210.131.3332.934.755.6%None0.0034.750.000.00
279th MHSWMH 1818005950896.561749800.6359.4157.357.192.22
289th Line525Class 25.048.329.79.962.4%None0.009.960.000.00
2910th MHSWMH 18A15005950891.521749808.9559.1156.9656.92.21
3010th Line525Class 213.141.2143.243.741.2%None0.0043.740.000.00
3111th MHSWMH 1910505950878.421749850.1658.4556.456.232.22
3211th Line525Class 216.9333.7837.840.176.3%None0.0040.170.000.00
3312th MHSWMH 19.110505950861.491749883.9455.6153.8553.292.32
3412th Line525Class 21.1000000018.058.18.211.1%None0.008.210.000.00
3513th MHSWMH 19.210505950860.391749891.9955.0153.253.141.87
3613th Line525Class 29.8926.4928.330.367.4%None0.0030.360.000.00
3714th MHSWMH 2018005950850.51749918.4853.3251.0651.012.31
3814th Line630SDR1743.97-12.2345.663.7839.7%Anc. Block0.0019.0541.423.31
39Outlet StructureOutlet 35950806.531749906.2532.87
40
SW
Cell Formulas
RangeFormula
P3, P37, P35, P33, P31, P29, P27, P25, P23, P21, P19, P17, P15, P13, P11, P7, P5P3=M3-O3
F4, F38, F36, F34, F32, F30, F28, F26, F24, F22, F20, F18, F16, F14, F12, F6F4=D3-D5
G4, G38, G36, G34, G32, G30, G28, G26, G24, G22, G20, G18, G16, G14, G12, G6G4=E5-E3
H4, H38, H36, H34, H32, H30, H28, H26, H24, H22, H20, H18, H16, H14, H12, H6H4=SQRT(F4^2+G4^2)
I4, I38, I36, I34, I32, I30, I28, I26, I24, I22, I20, I18, I16, I14, I12, I6I4=(J4+1)*H4
J4, J38, J36, J34, J32, J30, J28, J26, J24, J22, J20, J18, J16, J14, J12, J6J4=(O3-N5)/H4
K4, K38, K36, K34, K32, K30, K28, K26, K24, K22, K20, K18, K16, K14, K12, K8, K6K4=IF(J4<0.1,"None",IF(J4<=0.2,"CTB",IF(J4>0.2,"Anc. Block")))
S4, S38, S36, S34, S32, S30, S28, S26, S24, S22, S20, S18, S16, S14, S12, S6S4=MEDIAN(0,$I4-SUM($P4:P4),$I4*(S$2-MIN($P3:$P5))/ABS($P5-$P3)-SUM($P4:P4))
T4:V4, T38:V38, T36:V36, T34:V34, T32:V32, T30:V30, T28:V28, T26:V26, T24:V24, T22:V22, T20:V20, T18:V18, T16:V16, T14:V14, T12:V12, T6:V6T4=MEDIAN(0,$I4-SUM($P4:S4),$I4*(T$2-MIN($P3:$P5))/ABS($P5-$P3)-SUM($P4:S4))
Named Ranges
NameRefers ToCells
_FilterDatabase=SW!$A$1:$AC$293P3, F4:K4, S4:V4, P5, F6:K6, S6:V6, P7, K8, P11, F12:K12, S12:V12, P13, F14:K14, S14:V14, P15, F16:K16, S16:V16, P17, F18:K18, S18:V18, P19, F20:K20, S20:V20, P21, F22:K22, S22:V22, P23, F24:K24, S24:V24, P25, F26:K26, S26:V26, P27, F28:K28, S28:V28, P29, F30:K30, S30:V30, P31, F32:K32, S32:V32, P33, F34:K34, S34:V34, P35, F36:K36, S36:V36, P37, F38:K38, S38:V38
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AA4:XFD4,AA6:XFD277,S7:Z9,S11:Z11,S13:Z13,S15:Z15,S17:Z17,S19:Z19,S21:Z21,S23:Z23,S25:Z25,S27:Z27,S29:Z29,S31:Z31,S33:Z33,S35:Z35,S37:Z37,S39:Z39,S41:Z41,S43:Z43,S45:Z45,S47:Z47,S49:Z49,S51:Z51,S53:Z53,S55:Z55,S57:Z57,S59:Z59,S61:Z61,S63:Z63,S65:Z65,S67:Z67Expression=MOD(ROW(),2)=1textNO
 
Upvote 0
Sorry I've taken a while to get back to this, it sort of feels like trigonometry homework! I'm definitely a math geek, but this trends towards the drudgery side of math.

Anyway, this looks like it depends on how you enter the depth values, O2 and M5. Is this depth measured from the bottom of the pipe, or the top of the pipe? Also, is this depth measured from the center of the manhole, or the edge of the manhole? The first question is almost immaterial, but the second one is key. If the depth is measured from the edge (which seems likely since the gradient is calculated from the Pipe Outlet RL to Pipe Inlet RL), then the depths we use in the S4 formulas are already correct, and we just have to adjust the Calculated Line Length (Flag). To do that, just change the H4 formula to:

=SQRT(F4^2+G4^2)-(B4+B6)/2000

If the depths in the P column are not from the edge of the manhole, then I don't quite understand the relationship between the M, N, O, P values. If you could show a diagram, that would help.
 
Upvote 0
Hi Eric,

No problem, I appreciate your help.

I had the spreadsheet reviewed internally and changes were made to correct some formula's I had overlooked. One of the things that had to be changed was the formula in cell H4, like you pointed out - we were measuring from center of manhole to center of manhole.

I think I have everything sorted now. Thanks very much for your help with this.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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