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!
 
Sorry, a minor tweak to handle depths in the opposite order:

Book1
ABCDEFGH
1Manhole Name/Pipe size (mm)Calculated Line LengthMH Depth to Invert (m)1.534.56
2Upstream MHSWMH 9.51.2
31st Line300282.70967741913.548387111.741935480
42nd MHSWMH 9.34.3
52nd Line375545.22580645226.1290322622.645161290
63rd MHSWMH 9.21.2
Sheet2
Cell Formulas
RangeFormula
E3:H3, E5:H5E3=MEDIAN(0,$C3-SUM($D3:D3),$C3*(E$1-MIN($D2:$D4))/ABS($D4-$D2)-SUM($D3:D3))
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
J.Ty. and Eric,

Thank you both a million. Your help has made my task so much easier!

All the best,

Walt Kerkmeer
 
Upvote 0
Thanks for the feedback and good luck!

J.Ty.
 
Upvote 0
Hi Eric,

Just thought I'd follow up on this and let you know that the formula you created has helped me enormously. I managed to create a formula on my own which I'm fairly proud of considering my limited knowledge in Excel, haha.

I would like to add another equation to the formula you created (if that's possible). In the below example, cell T94 calculates the length of pipe that falls within the 1.5-3m depth bracket (90.57m). This measure is from centre of manhole SWMH 9.1 to centre of manhole SWMH 9.

We are only going to get paid for actual length of pipe, i.e. from manhole wall to manhole wall. So this means we would have to subtract half of cell C93 and half of cell C95, and convert millimeters in column C to meters. If it makes it easier, I could change column C to show MH sizes in meters instead of millimeters, however ideally I'd like to keep it this way.

1580328864508.png
 
Upvote 0
To clarify this a bit better, please see below sketch of the difference between measuring centre to centre vs. actual length of pipe. Your help will be much appreciated.

1580331450160.png
 
Upvote 0
Ugh. That sounds tricky! You essentially want to subtract out 1/2 of the diameter of the first manhole from the 1st non-zero value, and subtract out 1/2 the diameter of the second manhole from the the last non-zero number. And it's possible that both those numbers are the same. Since as you drag the formula to the right, it keeps track of the length of pipe used so far, if we subtract out something from the first length, all the rest will be thrown off.

It might be easier to subtract out the manhole lengths from the calculated line length (flat, I think?) before we start. Then we'd have to calculate the adjusted calculated line length (actual), and also the starting and ending depths. Do you get the actual length from the flat length and the gradient? When I do a direct multiplication the results I get are not quite what's shown on your sheet.

Let me know and I'll think about it a bit more.
 
Upvote 0
Is it the case, that you may calculate the price using the old formula and subtract the price of a level pipe at the depth of the manhole, and of legnth qual to its diameter?

J.Ty.
 
Upvote 0
Hi Eric, that makes sense. Indeed we would have to subtract the manhole lengths from the flat line length first. This would in turn change the calculated gradient (because the calculated gradient is derived from subtracting the two pipe invert levels at each end by each other, and then dividing that by the calculated line length (flat)). This is how the calculated line length (flat) is calculated:

1580335528698.png


I'm getting the actual line length by this formula currently: =PRODUCT(H94,J94)+H94 which seems to me like a messy formula (I think it's messy because I refer to cell H94 twice) however I don't know how else I could do it.



@J.Ty. I could do that indeed, however I am hoping there is a way I can incorporate this calculation in the spreadsheet, before I do any price calculations. Reason is because for the pricing side of things, I have a completely different spreadsheet. I can't combine the two because they're both quite complex spreadsheets and it would get messy.
 
Upvote 0

Forum statistics

Threads
1,223,632
Messages
6,173,469
Members
452,516
Latest member
archcalx

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