Plumbing Reference · Free

Plumbing Formulas for Excel

All 35 formulas from the plumbing formula reference, rewritten as Microsoft Excel formulas you can paste straight into a cell. Each one comes with the input cells it expects, a named-range version that reads like English, and the answer it returns for a worked example. The IPC lookup tables are here too, ready to paste.

Every constant below is pulled from the same code that runs our calculators, so a formula you paste into a sheet returns the number the calculator returns. 27 of the 35 are a single expression; the other 8 need one of the tables pasted in, because the IPC is a book of tables and no amount of algebra changes that.

Set up your sheet first

Every formula on this page assumes the same simple layout: labels down column A, values down column B starting at row 2, and the answer in column E. Build that once and you can paste any formula here without editing a cell reference.

Cell Holds Example
A2 The input's name Flow
B2 The first input value 10
B3, B4 … Further inputs, in the order listed on each card 0.785
E2 The formula, and any second formula in E3 =0.4085*B2/B3^2
F, G, H … Any pasted lookup table Table 909.1

For the named-range versions, in Excel: select A2:B6, then Formulas → Create from Selection → Left column. Excel turns each label in column A into a name for the value beside it, and =0.4085*Flow/Bore^2 starts working. Named ranges are worth the two minutes on any sheet somebody else will have to read. Google Sheets has no equivalent menu — names go in one at a time under Data → Named ranges, which is slower but the same idea.

Pipe Sizing & Water Supply

The supply side is where a spreadsheet earns its keep, because sizing a water line is genuinely iterative — you guess a size, check it against both the velocity cap and the friction budget, and go again. In a sheet you drop the size into one cell and read both answers at once.

Water Supply Fixture Units → Peak Demand (GPM)

Needs a table: Hunter's curve

Input cells

B2
— Total WSFU · example 16.4
F2:H38
— Hunter's curve table (paste below) · example —
B3
— Helper — row index · example =MATCH(B2,$F$2:$F$38,1)

Paste into Excel

=IF(B2>=INDEX($F$2:$F$38,37),INDEX($G$2:$G$38,37),INDEX($G$2:$G$38,B3)+(B2-INDEX($F$2:$F$38,B3))/(INDEX($F$2:$F$38,B3+1)-INDEX($F$2:$F$38,B3))*(INDEX($G$2:$G$38,B3+1)-INDEX($G$2:$G$38,B3)))

Named-range version

=IF(WSFU>=MaxFU,MaxDemand,INDEX(DemandTank,Row)+(WSFU-INDEX(FixtureUnits,Row))/(INDEX(FixtureUnits,Row+1)-INDEX(FixtureUnits,Row))*(INDEX(DemandTank,Row+1)-INDEX(DemandTank,Row)))

The example returns

18.16 gpm flush tank · 32.12 gpm flushometer valve

Hunter's curve is a table, not an equation, so this is the one formula on the page that cannot exist without pasting data in. The helper cell finds the bracketing row and the main formula interpolates between it and the next — which is what the calculator does. The leading IF is not decoration: past the last row (1000 fixture units) the interpolation would reach for a row that does not exist and return #REF!, so the curve is clamped there exactly as the calculator clamps it. Do not use VLOOKUP alone — it returns the row below and understates demand between anchors. Below the first anchor the calculator scales linearly from the origin instead, so counts under 1 fixture unit are outside what this formula covers.

Pipe Velocity

One formula

Input cells

B2
— Flow, gpm · example 10
B3
— Inside diameter, inches · example 0.785 (3/4 in Type L copper)

Paste into Excel

=0.4085*B2/B3^2

Named-range version

=0.4085*Flow/Bore^2

The example returns

6.63 ft/s

Bore, not nominal size — a nominal 3/4 in is 0.785 in in Type L copper and 0.681 in in PEX, and the square term makes that a 33% difference in velocity. Add a conditional format against 8 ft/s cold and 5 ft/s hot and the sheet flags its own violations. Those two limits are ASPE and tube-manufacturer practice, not IPC numbers.

Hazen-Williams Friction Loss

One formula

Input cells

B2
— Flow, gpm · example 10
B3
— Roughness coefficient C · example 140 (copper)
B4
— Inside diameter, inches · example 0.785

Paste into Excel

=4.52*B2^1.852*100/(B3^1.852*B4^4.8704)

Named-range version

=4.52*Flow^1.852*100/(CFactor^1.852*Bore^4.8704)

The example returns

11.08 psi per 100 ft

Returns psi per 100 ft. Excel's ^ operator is the same precedence as elsewhere, but the parentheses around the denominator are load-bearing — without them the d term multiplies instead of divides and the answer comes back absurdly small. Valid for water between 40 and 75 °F in turbulent flow only.

Available Pressure for Friction

One formula

Input cells

B2
— Static supply pressure, psi · example 60
B3
— Fixture minimum, psi · example 15
B4
— Height to highest fixture, ft · example 20
B5
— Meter loss, psi · example 8
B6
— Softener / filter / backflow losses, psi · example 0

Paste into Excel

=B2-B3-0.4331*B4-B5-B6

Named-range version

=Static-FixtureMin-0.4331*Height-MeterLoss-DeviceLoss

The example returns

28.34 psi left for pipe friction

Whatever survives all four deductions is the entire budget for pipe friction. Measure the static pressure rather than assuming it, and measure it at night when mains pressure peaks. Every device someone adds later — a softener, a whole-house filter — comes straight out of this number.

Allowable Friction Loss per 100 ft

One formula

Input cells

B2
— Available pressure, psi · example 28.338
B3
— Developed length, ft · example 120

Paste into Excel

=B2/B3*100

Named-range version

=Available/DevelopedLength*100

The example returns

23.62 psi per 100 ft allowable

Pair this with the Hazen-Williams cell above: the smallest pipe whose actual loss stays under this number is the answer. At 23.62 psi/100 ft, a nominal 1 in copper carrying 18 gpm loses 8.98 and passes, while 3/4 in loses far more and fails. Residential jobs usually land between 2 and 8.

Developed Length & Fitting Equivalents

Needs a table: Fitting L/D ratios

Input cells

B2
— Measured pipe run, ft · example 60
B3
— Inside diameter, inches · example 0.785
F2:G9
— Fitting table (paste below): L/D, then your count · example —

Paste into Excel

=B2+SUMPRODUCT($F$2:$F$9,$G$2:$G$9)*B3/12

Named-range version

=MeasuredRun+SUMPRODUCT(FittingLD,FittingCount)*Bore/12

The example returns

80.1 ft developed from a 60 ft run with 6 elbows, 2 branch tees and a ball valve

Equivalent length is computed from the L/D ratio and the bore, not read off a per-size table — which is why one SUMPRODUCT covers every fitting and every pipe size at once. A 90° elbow on 3/4 in copper is only 1.96 ft, but a globe valve is 22.2 ft — more than the elbows put together.

Drainage, Waste & Vent

The drainage side is where a spreadsheet is most likely to go quietly wrong, because most of it is code tables rather than arithmetic. Four of the eight below need a table pasted in. That is not a limitation of Excel — it is what the IPC actually is.

Drainage Fixture Units & Drain Size

Needs a table: Tables 709.1 and 710.1

Input cells

F2:G29
— Fixture DFU table and your counts · example —
B2
— Total DFU · example =SUMPRODUCT($F$2:$F$29,$G$2:$G$29)
B3
— Water closet on this drain? · example TRUE
J2:K6
— Capacity table for the application · example —

Paste into Excel

=IF(B3,MAX(3,INDEX($J$2:$J$6,MATCH(TRUE,INDEX($K$2:$K$6>=B2,0),0))),INDEX($J$2:$J$6,MATCH(TRUE,INDEX($K$2:$K$6>=B2,0),0)))

Named-range version

=IF(HasWC,MAX(3,XLOOKUP(TRUE,Capacity>=TotalDFU,Size)),XLOOKUP(TRUE,Capacity>=TotalDFU,Size))

The example returns

18 DFU with a water closet → 3" (the table alone says 2" — governed by the water closet, not the table)

The MAX wrapper is the part every spreadsheet on the internet leaves out. A two-bath house is 18 DFU, which the building-drain table carries on 2 in pipe — but a water closet floors a building drain at 3 in regardless. Note the floor applies to the building drain, not to a horizontal branch. Use the branch column for branches and the stack columns for stacks; a tall stack legitimately carries more than a short one.

Minimum Drain Slope

One formula

Input cells

B2
— Nominal pipe size, inches · example 3

Paste into Excel

=IF(B2<=2.5,0.25,IF(B2<=6,0.125,0.0625))

Named-range version

=IF(Size<=2.5,0.25,IF(Size<=6,0.125,0.0625))

The example returns

2 in → 0.25 in/ft · 3 in → 0.125 in/ft

Returns inches per foot. IPC 2021 has only two rows that matter in a house — 1/4 in/ft up to 2-1/2 in, 1/8 in/ft from 3 to 6 in — so the nested IF is honestly the whole table. Piping upstream of a grease interceptor stays at 1/4 in/ft whatever the size, which the formula does not know about; add that condition yourself if it applies.

Slope as Percent & Total Fall

One formula

Input cells

B2
— Slope, in/ft · example 0.125
B3
— Run, ft · example 40

Paste into Excel

=B2*B3 fall in inches =B2/12*100 slope as a percent

Named-range version

=Slope*Run =Slope/12*100

The example returns

5.0 in of fall · 1.04%

The fall cell is the one that decides whether a run clears a footing or fits a joist bay. 1/4 in/ft is 2.08% and 1/8 in/ft is 1.04%. The same 40 ft run drops 10.0 in at 1/4 and 5.0 in at 1/8 — which is usually why a long run goes up a size.

Manning's Equation — Drain Capacity

One formula

Input cells

B2
— Inside diameter, inches · example 3
B3
— Slope, in/ft · example 0.125
B4
— Manning roughness n · example 0.01 (plastic)

Paste into Excel

=(1.486/B4)*(B2/48)^(2/3)*(B3/12)^0.5 velocity, ft/s =PI()/8*(B2/12)^2*E2*448.831 gpm at half full

Named-range version

=(1.486/Roughness)*(Bore/48)^(2/3)*(Slope/12)^0.5 =PI()/8*(Bore/12)^2*Velocity*448.831

The example returns

2.39 ft/s · 26.3 gpm

Two cells, because you want the velocity as well as the flow. B2/48 is the hydraulic radius of a half-full pipe in feet — diameter over 4, then inches to feet. The PI()/8 term is half of a full circle's area. Note the exponent needs its parentheses: ^(2/3) is a cube root of a square, while ^2/3 is a square divided by three, and Excel will not warn you. 448.831 converts cubic feet per second to gpm; it is the one constant here we carry rounded rather than as 60 × 7.48052, so that a sheet lands on exactly what the calculator prints. Watch the velocity cell rather than the gpm one: below about 2 ft/s solids drop out, which is why oversizing a drain at a flat grade can make it worse rather than better.

Vent Size

Needs a table: Stocked vent sizes

Input cells

B2
— Drain size served, inches · example 3
B3
— Developed length of the vent, ft · example 30
F2:F10
— Stocked vent sizes (paste below) · example —

Paste into Excel

=INDEX($F$2:$F$10,MATCH(TRUE,INDEX($F$2:$F$10>=MAX(1.25,B2/2),0),0)+IF(B3>40,1,0))

Named-range version

=XLOOKUP(TRUE,VentSizes>=MAX(1.25,Drain/2),VentSizes) then one size up if Length>40

The example returns

3 in drain over 30 ft → 1-1/2" · the same drain over 60 ft → 2"

Half the drain diameter, floored at 1.25 in, rounded up to a size you can actually buy — then one size larger again past 40 ft of developed length. The 1.25 in floor only ever binds at 2 in drains and below; at 3 in and up the halving already clears it. The 40 ft rule upsizes the whole run, not just the excess, which is the part the MATCH offset is doing.

Trap Arm Maximum Length

Needs a table: Table 909.1

Input cells

B2
— Trap arm size, inches · example 2
F2:H6
— Table 909.1 (paste below) · example —

Paste into Excel

=INDEX($H$2:$H$6,MATCH(B2,$F$2:$F$6,0))

Named-range version

=XLOOKUP(TrapArmSize,TableSize,MaxLength)

The example returns

1-1/2 in → 6 ft · 2 in → 8 ft · 3 in → 12 ft

An exact MATCH, not an approximate one — a trap arm is a listed size, so a 0 as the third argument is correct here and a 1 would silently return the wrong row for an in-between value. There is a floor as well as a ceiling: the vent must also sit at least two pipe diameters downstream of the trap weir. Self-siphoning fixtures, water closets above all, are not length-limited at all.

Grease Interceptor Sizing

One formula

Input cells

B2:B4
— Sink L × W × D, inches · example 24 · 24 · 12
B5
— Compartments · example 3
B6
— Fill fraction · example 0.75
B7
— Drain period, minutes · example 1
B8
— Seats — gravity method below · example 100
B9
— Meal turnover per hour · example 1
B10
— Waste flow per meal, gal · example 6
B11
— Retention, hours · example 2.5
B12
— Storage factor · example 1

Paste into Excel

=B2*B3*B4*B5/231 sink volume, gallons =E2*B6/B7 required flow, gpm =E3*2 grease capacity, lb =MAX(1000,B8*B9*B10*B11*B12) gravity interceptor, gallons

Named-range version

=Length*Width*Depth*Comps/231 =Volume*Fill/DrainPeriod =Flow*2 =MAX(1000,Seats*Turnover*GalPerMeal*RetentionHrs*StorageFactor)

The example returns

89.77 gal → 67.32 gpm → a 75 gpm / 150 lb unit · 100 seats → 1,500 gal

Two devices, two units, and sizing one with the other's method gives a plausible number that means nothing. The hydromechanical trap is rated in gpm; the gravity interceptor is rated in gallons. PDI-G101 defines grease capacity as exactly 2 lb per gpm, so that cell is a definition rather than a lookup. The MAX against 1,000 gal matters more than the arithmetic — below roughly 65 seats the local FOG minimum governs and the calculation never binds.

Rainwater Yield & Cistern Storage

One formula

Input cells

B2
— Catchment area, ft² · example 2000
B3
— Rainfall over the period, inches · example 3.5
B4
— Runoff coefficient Cr · example 0.85
B5
— Collection efficiency Ce · example 0.85
B6
— First flush per ft², gal · example 0.015
B7
— Rain events in the period · example 4
B8
— Daily demand, gal · B9 dry-spell days · example 60 · 21

Paste into Excel

=B2*B3*(7.48052/12) gross yield, gallons =MIN(E2,B2*B6*B7) first flush diverted =(E2-E3)*B4*B5 net yield, gallons =MIN(B8*B9,E4) cistern, gallons

Named-range version

=Area*Rainfall*(7.48052/12) =MIN(Gross,Area*FirstFlushRate*Events) =(Gross-FirstFlush)*Runoff*Efficiency =MIN(Demand*DrySpell,NetYield)

The example returns

4,364 gal gross − 120 gal first flush → 3,066 gal net · cistern governed by the dry spell at 1,260 gal

Four cells rather than one, because the first flush comes off the gross yield BEFORE the coefficients are applied — divert the dirtiest water first, then lose a share of what is left to the screen and the filter. Doing it in the other order, or skipping it, overstates the yield by 2.8% on this roof. Write the constant as 7.48052/12 rather than the 0.62 you will see quoted everywhere — it is one cubic foot of water spread an inch deep over a square foot, and letting Excel do the division keeps the full precision. Area is the horizontal projection of the roof, not its slope length, because rain falls vertically. The final MIN is the whole design: a tank bigger than the roof can refill just sits part empty.

Storm & Roof Runoff Flow

One formula

Input cells

B2
— Roof area, ft² · example 2000
B3
— Design rainfall, in/hr · example 4
B4
— Drain bore, inches · example 4.026 (4 in Sch 40)
B5
— Slope, in/ft · example 0.125
B6
— Manning roughness n · example 0.01

Paste into Excel

=B2*B3*7.48052/12/60 runoff, gpm =(1.486/B6)*(B4/48)^(2/3)*(B5/12)^0.5 velocity, ft/s =PI()/4*(B4/12)^2*E3*448.831 full-bore capacity, gpm

Named-range version

=Area*Rainfall*7.48052/12/60 =(1.486/Roughness)*(Bore/48)^(2/3)*(Slope/12)^0.5 =PI()/4*(Bore/12)^2*Velocity*448.831

The example returns

83.1 gpm off the roof · a 4 in drain carries 115.3 gpm at 2.91 ft/s

Runoff is strictly linear in area and rainfall, so 41.56 gpm per 1,000 ft² at 4 in/hr scales exactly — the one place a per-square-foot rule of thumb is safe. The capacity line is the same Manning equation as the drain formula above but at FULL bore rather than half, which is why the area term is PI()/4 rather than PI()/8. This publishes the flow, not the code size: IPC Tables 1106.2 and 1106.3 govern leader and horizontal storm drain sizing and are deliberately not reproduced, the same call made for the vent-stack table.

Septic Tank & Leach Field

Needs a table: Tank minimums by bedroom

Input cells

B2
— Bedrooms · example 3
B3
— Gallons per bedroom per day · example 150
B4
— Soil application rate, gal/ft²/day · example 0.8 (loam)
B5
— Trench width, ft · example 3
F2:G6
— Tank minimums table (paste below) · example —

Paste into Excel

=B2*B3 daily flow, gpd =E2*2 retention volume, gal =INDEX($G$2:$G$6,MATCH(TRUE,INDEX($F$2:$F$6>=B2,0),0)) code minimum =MAX(E3,E4) tank, gallons =E2/B4 leach field, ft2 =E6/B5 trench length, ft

Named-range version

=Bedrooms*GalPerBedroom =DailyFlow*2 =XLOOKUP(TRUE,MaxBedrooms>=Bedrooms,MinGallons) =MAX(Retention,Minimum) =DailyFlow/ApplicationRate =LeachField/TrenchWidth

The example returns

450 gpd → retention 900 gal vs minimum 1,000 gal → 1,000 gal tank, governed by the minimum · field 563 ft² = 188 ft of trench

The MAX is the whole tank calculation: on ordinary numbers the published minimum governs up to four bedrooms and retention only takes over at five, so a sheet that computes retention alone undersizes almost every house it is used on. The soil rate is the real variable — the identical house needs 375 ft² of field in sand and 1,875 ft² in slow clay, a 5x swing, while the tank does not move at all. Septic is not IPC territory: it falls to the IPSDC where adopted and to state and county health departments everywhere else, so treat every input here as a starting value and confirm the local ones. Setbacks, water table and a witnessed perc test are out of scope.

Grey Water Yield & Irrigable Area

One formula

Input cells

B2
— Occupants · example 3
B3
— Shower, gal/person/day · example 25
B4
— Lavatory, gal/person/day · example 5
B5
— Washer, gal/load · example 20
B6
— Washer loads per week · example 5
B7
— Irrigation demand, gal/ft²/week · example 0.6

Paste into Excel

=B2*(B3+B4)+B5*B6/7 daily yield, gpd =E2*24/24 maximum storage, gal =E2*7/B7 irrigable area, ft2

Named-range version

=Occupants*(Shower+Lavatory)+WasherPerLoad*LoadsPerWeek/7 =DailyYield*24/24 =DailyYield*7/IrrigationRate

The example returns

104.3 gpd (shower 75.0, lavatory 15.0, washer 14.3) · storage 104 gal · 1,217 ft² irrigable

The storage line looks pointless and is the most important one here: the hold is 24 hours, so maximum storage always equals exactly one day of yield. Untreated grey water goes septic past a day, so unlike a rainwater cistern it cannot bridge between events at all — it is a surge vessel, and the design work moves to the distribution field. The washer divides by 7 because it is per load per week while the others are per person per day; mixing those two bases is the easy error. Planting choice swings the area 4x, from 608 ft² of cool-season lawn to 2,433 ft² of drought-tolerant planting. Kitchen sink and dishwasher are deliberately absent — that is black water in most jurisdictions.

Pressure & Pump Head

Everything here is closed-form, so this is the section that ports to a spreadsheet most cleanly. Two of them — thermal expansion and pressure-tank drawdown — carry a trap that catches most published spreadsheets: they are Boyle's law problems, so the pressures have to be absolute.

Pressure ↔ Head of Water

One formula

Input cells

B2
— Feet of head · example 150.1
B3
— …or psi · example 65

Paste into Excel

=0.4331*B2 psi from feet =B3/0.4331 feet from psi

Named-range version

=0.4331*Head =Pressure/0.4331

The example returns

65 psi = 150.1 ft of head

Write the second one as a division by 0.4331 rather than multiplying by 2.31. The reciprocal is 2.3089, so the rounded 2.31 introduces a small error that compounds once you feed it into a pump head total. Both constants shift slightly with water temperature — this is the one figure on the page that is a measurement rather than a definition.

Static Pressure Loss from Elevation

One formula

Input cells

B2
— Vertical rise, ft · example 25

Paste into Excel

=0.4331*B2

Named-range version

=0.4331*Height

The example returns

10.83 psi lost over a 25 ft rise

The only loss in a plumbing system that does not depend on flow — it is there whether anything is running or not. One storey costs about 4.33 psi. On a 45 psi supply, reaching a third floor spends roughly a fifth of the budget before a single foot of pipe friction.

Total Dynamic Head

One formula

Input cells

B2
— Static lift, ft · example 12
B3
— Friction loss, psi/100 ft · B4 length · example · 40
B5
— Discharge pressure required, psi · example 0
B6
— Velocity, ft/s · example 4.73

Paste into Excel

=B2+(B3*B4/100)/0.4331+B5/0.4331+B6^2/(2*32.174)

Named-range version

=StaticLift+FrictionPsi/0.4331+DischargePsi/0.4331+Velocity^2/(2*32.174)

The example returns

14.43 ft of total dynamic head

Four terms, all converted to feet before they are added — mixing psi and feet in one sum is the most common error in a pump sheet. The velocity head term is genuinely tiny in domestic work (0.347 ft here, under 3% of the total) but costs nothing to include. For a sump the discharge-pressure term is exactly zero; for a well pump it usually dominates everything else.

Pressure-Reducing Valve Threshold

One formula

Input cells

B2
— Static pressure, psi · example 92

Paste into Excel

=IF(B2>80,"PRV required","No PRV required")

Named-range version

=IF(Static>80,"PRV required","No PRV required")

The example returns

92 psi → PRV required · 78 psi → no PRV required

IPC 604.8 puts the ceiling at 80 psi static for building water distribution. Measure at night — a system reading 78 psi at 4 pm can sit well over 80 psi at 4 am, and this cell will happily tell you the wrong thing from a daytime reading. Service lines to sill cocks and outside hydrants are excepted.

Thermal Expansion Volume

Needs a table: Water density

Input cells

B2
— System volume, gal · example 50
B3
— Cold °F · B4 hot °F · example 40 · 140
B5
— Supply psi · B6 ceiling psi · example 60 · 80
F2:G19
— Water density table (paste below) · example —

Paste into Excel

=INDEX($G$2:$G$19,MATCH(B3,$F$2:$F$19,1))/INDEX($G$2:$G$19,MATCH(B4,$F$2:$F$19,1))-1 expansion fraction =B2*E2/(1-(B5+14.7)/(B6+14.7)) tank volume, gal

Named-range version

=DensityCold/DensityHot-1 =SystemGallons*Fraction/(1-(SupplyPsi+14.7)/(MaxPsi+14.7))

The example returns

1.71% expansion · 0.86 gal to absorb · 4.05 gal tank → a 4.4 gal shell

Water expands because it gets less dense, so the fraction is a ratio of two densities minus one — mass is conserved, volume is not. The 14.7 in both brackets is the whole formula: it is Boyle's law, so the pressures must be absolute, and using gauge pressure is the classic error that undersizes the tank. Note the ceiling is the 80 psi code threshold, not the 150 psi relief-valve setting — sizing against the relief valve makes almost every house look like it needs the smallest tank made.

Pressure Tank Drawdown

One formula

Input cells

B2
— Cut-in psi · B3 cut-out psi · example 30 · 50
B4
— Pre-charge psi · example 28
B5
— Pump gpm · B6 minimum run, min · example 10 · 1

Paste into Excel

=MIN(1,(B4+14.7)/(B2+14.7))-MIN(1,(B4+14.7)/(B3+14.7)) drawdown fraction =B5*B6/E2 required shell, gal

Named-range version

=MIN(1,PreAbs/CutInAbs)-MIN(1,PreAbs/CutOutAbs) =PumpGpm*RunMinutes/Fraction

The example returns

29.53% of the shell at a 30/50 switch · a 10 gpm pump needs a 44 gal tank

Absolute pressures again, and again it is Boyle's law. Because the answer is a ratio rather than a difference, the same 20 psi span delivers more at a lower band — 34.5% at 20/40 against 25.8% at 40/60. Widening the band is what actually helps: 30/70 reaches 45.1%. A "20 gallon" tank delivers about 5.9 gallons.

Water Heating & Gas Piping

All five are closed-form and all five fit on one row of a sheet, which makes this the section worth building as a comparison table — put six heaters down the rows and let the first-hour rating column pick the winner.

Temperature Rise & Recovery Rate

One formula

Input cells

B2
— Input, BTU/hr · example 40000
B3
— Thermal efficiency · example 0.8
B4
— Temperature rise, °F · example 90
B5
— …or element kW, electric · example 4.5

Paste into Excel

=B2*B3/(8.33*B4) gas, gallons per hour =B5*3412.14/(8.33*B4) electric, gallons per hour

Named-range version

=Input*Efficiency/(8.33*Rise) =Kilowatts*3412.14/(8.33*Rise)

The example returns

42.68 gph from a 40,000 BTU/hr gas heater at 80% · 20.48 gph from a 4.5 kW element

Recovery rate is what separates a gas heater from an electric one of the same size, and the gap is more than 2x on the same rise. 8.33 is the weight of a gallon of water and 1 BTU raises 1 lb by 1 °F, so the denominator is the energy to lift a gallon through the rise. Use the winter inlet temperature, not the summer one.

Tankless Flow Capacity

One formula

Input cells

B2
— Input, BTU/hr · example 199000
B3
— Thermal efficiency · example 0.95
B4
— Temperature rise, °F · example 70

Paste into Excel

=B2*B3/(499.8*B4)

Named-range version

=Input*Efficiency/(499.8*Rise)

The example returns

5.40 gpm at a 70 °F rise · 4.73 gpm at 80 °F

The constant is 499.8, not the 500 you will see everywhere — it is 8.33 lb per gallon times 60 minutes, and the rounded 500 is about 0.04% optimistic. Size on the winter rise: the same unit that gives 5.40 gpm at a 70 °F rise gives only 4.73 gpm at 80 °F, a 12.5% loss. Undersizing on the summer number is why tankless units disappoint in January.

First-Hour Rating

One formula

Input cells

B2
— Tank size, gal · example 40
B3
— Recovery, gph · example 42.68

Paste into Excel

=0.7*B2+B3

Named-range version

=0.7*TankGallons+Recovery

The example returns

70.7 gal in the first hour from a 40 gal gas heater

This is the column to sort a comparison table on, not tank size. Only about 70% of a tank is usable before incoming cold dilutes delivery below setpoint, so recovery dominates the back half of the hour — which is how a 40 gal gas heater (70.7 gal) out-delivers a 50 gal electric one (55.5 gal).

Mixing Valve / Tempered Water Ratio

One formula

Input cells

B2
— Delivered °F · example 120
B3
— Cold inlet °F · example 50
B4
— Stored °F · example 140
B5
— Mixed flow, gpm · example 2.5

Paste into Excel

=(B2-B3)/(B4-B3) hot fraction =E2*B5 hot gpm drawn from the tank =(1-E2)*B5 cold gpm blended in =1/E2 storage multiplier

Named-range version

=(Delivered-Cold)/(Stored-Cold) =HotFraction*MixedFlow =(1-HotFraction)*MixedFlow =1/HotFraction

The example returns

77.8% hot · 1.94 gpm hot and 0.56 gpm cold of a 2.5 gpm draw · storage multiplier 1.286

The reciprocal of the hot fraction is a storage multiplier — at 77.8% hot, a 50 gal tank behaves like 64.3 gal. Storing at the delivery temperature gives no bonus at all (120/120 is 100% hot and a 1.00x multiplier) and parks the tank in the Legionella range. Note the cold inlet moves it the other way: a colder winter inlet raises the hot fraction exactly when recovery is slowest.

Gas Load → CFH

One formula

Input cells

B2
— Total connected load, BTU/hr · example 150000
B3
— Heating value, BTU/ft³ · example 1000 natural · 2516 propane

Paste into Excel

=B2/B3

Named-range version

=ConnectedLoad/HeatingValue

The example returns

150,000 BTU/hr on natural gas → 150 CFH

The simplest formula on the page and the one most often applied to the wrong number: sum the input ratings of every appliance downstream of the section you are sizing, not the whole house, and size each section for what it actually carries. Natural gas runs roughly 950 to 1,100 BTU/ft³, so confirm the local figure with the utility. Fuel gas is a separate code — IFGC 402.4 and NFPA 54, not the IPC.

Volume, Conversions & Waste

The small arithmetic that decides how a system feels rather than whether it passes. How long the hot water takes to arrive, what a unit on a European spec sheet means in gpm, and what a drip actually costs over a year.

Pipe Volume & Gallons per Foot

One formula

Input cells

B2
— Inside diameter, inches · example 0.785 (3/4 in Type L copper)
B3
— Run length, ft · example 50
B4
— Flow while purging, gpm · example 2

Paste into Excel

=PI()/4*B2^2*12/231 gallons per foot =E2*B3 gallons in the run =E3*8.33 weight of that water, lb =E3/B4*60 seconds to purge it

Named-range version

=PI()/4*Bore^2*12/231 =PerFoot*Length =Gallons*8.33 =Gallons/PurgeFlow*60

The example returns

0.02514 gal/ft · 1.26 gal in 50 ft · 10.5 lb · 38 s to purge

The first cell collapses to the constant every plumber half-remembers: PI()/4 x 12 / 231 is 0.0408, so gallons per foot is 0.0408 x diameter squared. Two things fall out of it worth keeping. 40 ft of 3/4 inch copper is about a gallon, which is the mental shortcut for a purge or a chlorination charge. And because the volume goes as the square of the bore, upsizing a hot line makes the wait for hot water WORSE, not better — the fourth cell is the one that proves it.

Unit Conversion

Needs a table: Conversion factors

Input cells

B2
— Value to convert · example 10
B3
— From unit · example gpm
B4
— To unit · example lpm
F2:H30
— Conversion factor table (paste below) · example —

Paste into Excel

=B2*INDEX($H$2:$H$30,MATCH(B3,$G$2:$G$30,0))/INDEX($H$2:$H$30,MATCH(B4,$G$2:$G$30,0))

Named-range version

=Value*XLOOKUP(FromUnit,UnitKey,ToBase)/XLOOKUP(ToUnit,UnitKey,ToBase)

The example returns

10 gpm = 37.8541 L/min · 60 psi = 138.5 ft of head · 1 bar = 14.5038 psi

Every unit in a category carries a factor to that category's base, so one formula converts any pair: multiply into the base, divide out of it. Use exact matching, and keep the categories separate — nothing stops MATCH finding a length unit when you meant a volume. Temperature is the exception and cannot use this formula at all, because it is an offset scale rather than a ratio: °C to °F is =B2*9/5+32, and a temperature RISE converts by ratio alone, so a 90 °F rise is 50 °C and not 32.2. The other trap is the imperial gallon at 1.2009 US gallons — a 20% error hiding on any spec sheet that just says "gallons".

Leak & Water Waste Cost

One formula

Input cells

B2
— Drips per minute · example 60
B3
— Water rate, $ per 1,000 gal · example 5.50
B4
— Sewer rate, $ per 1,000 gal · example 7.00
B5
— Hot fraction, 0 to 1 · example 1
B6
— Temperature rise, °F · example 70
B7
— Heater efficiency · B8 $ per therm · example 0.8 · 1.40

Paste into Excel

=B2*1440/15140 gallons per day =E2*365 gallons per year =E3/1000*(B3+B4) water and sewer per year =E3*B5*8.33*B6/B7/100000*B8 energy per year, gas =E4+E5 total per year

Named-range version

=DripsPerMinute*1440/15140 =GallonsPerDay*365 =GallonsPerYear/1000*(WaterRate+SewerRate) =GallonsPerYear*HotFraction*8.33*Rise/Efficiency/100000*EnergyRate =WaterAndSewer+Energy

The example returns

5.71 gpd = 2,083 gal/yr · $26.04/yr cold, $47.29/yr hot on gas

The /1000 is the term people drop, and dropping it inflates the answer a thousandfold — both utility rates are quoted per 1,000 gallons. The hot-water line is what almost every published leak calculator omits: the same drip is $26.04 a year cold and $47.29 hot, 1.82x, because you paid to heat it before it escaped — energy is 44.9% of the hot total. For an electric heater, divide by 3412.14 for kWh instead of 100,000 for therms. The drip constant is the USGS figure of 15,140 drips per gallon, which reconciles with a 0.25 mL drop.

Pricing & Business

Not code, and not physics — but the arithmetic that decides whether the job was worth doing, and the part of a plumbing spreadsheet most likely to be quietly wrong. Put your own rates in the input cells; the numbers below are the calculators' defaults, not a price book.

Job Price — Margin, not Markup

One formula

Input cells

B2
— Labour hours · B3 labour rate · example 10 · 110
B4
— Fixture cost · example 850
B5
— Material cost · example 450
B6
— Overhead, percent · example 15
B7
— Target margin, percent · example 25

Paste into Excel

=B2*B3+B4+B5 direct cost =E2*(1+B6/100) break-even =E3/(1-B7/100) price at that MARGIN =E3*(1+B7/100) price at the same MARKUP =E4-E3 profit at margin

Named-range version

=Hours*Rate+Fixtures+Materials =Direct*(1+Overhead/100) =BreakEven/(1-Margin/100) =BreakEven*(1+Margin/100) =Price-BreakEven

The example returns

direct $2,400 → break-even $2,760 → $3,680 at margin ($920 profit) but only $3,450 at markup, which delivers 20.0% and $230 less

Two cells, one character apart, and the gap between them is the most expensive mistake in the trade. Margin divides by (1 − margin); markup multiplies by (1 + markup). They are not the same number and never have been: a 25% markup is exactly a 20% margin, which on this job is $230 of profit that simply does not arrive. Build both cells side by side in your sheet and the error becomes impossible to make. To hit a target margin from a markup, the markup needed is margin ÷ (1 − margin) — 25% margin needs a 33.3% markup.

Loaded Labour Rate

One formula

Input cells

B2
— Hourly wage · example 38
B3
— Labour burden, percent · example 32
B4
— Overhead per technician, per year · example 11000
B5
— Billable hours per year · example 1560
B6
— Target margin, percent · example 40

Paste into Excel

=B2*2080*(1+B3/100)+B4 annual cost of the tech =E2/B5 loaded cost per billable hour =E3/(1-B6/100) bill rate =E4/B2 multiple of the wage =B5/2080 utilisation

Named-range version

=Wage*2080*(1+Burden/100)+Overhead =AnnualCost/BillableHours =LoadedCost/(1-Margin/100) =BillRate/Wage =BillableHours/2080

The example returns

$115,333 a year → $73.93 loaded → $123.22 bill rate, 3.24x the wage at 75% utilisation

The cell that matters is the fourth one down, not the wage at the top. Utilisation moves the bill rate further than pay does, and in the useful direction. Drop billable hours to 1,000 and the same technician must bill $192.22; lift them to 1,800 and it falls to $106.79. Raising the wage 20% only moves it to $145.51. Note 2080 is PAID hours a year, while B5 is the smaller number you can actually invoice — conflating the two is what produces a rate that looks fine and loses money.

Whole-House Repipe Cost

One formula

Input cells

B2
— Floor area, ft² · example 1800
B3
— Material rate, $ per ft² · example 5 PEX · 6 CPVC · 9 copper
B4
— Access factor · example 0.8 easy · 1.0 average · 1.6 difficult
B5
— Storeys · B6 bathrooms · example 1 · 2
B7
— Permit · B8 drywall repair · example 450 · 1500
B9
— Regional factor · example 0.85 / 1.0 / 1.25 / 1.5

Paste into Excel

=B2*B3*B4*(1+MAX(0,B5-1)*0.15) after access and storeys =(E2+MAX(0,B6-2)*750+B7+B8)*B9 total =E3/B2 cost per ft2 =E3*(1-0.15) band low =E3*(1+0.15) band high

Named-range version

=Area*Rate*Access*(1+MAX(0,Storeys-1)*0.15) =(Subtotal+MAX(0,Baths-2)*750+Permit+Drywall)*Region =Total/Area =Total*(1-0.15) =Total*(1+0.15)

The example returns

$10,950 = $6.08 per ft², band $9,308–$12,592

The rates in B3, B4 and B9 are input cells on purpose — they are your costs, not a code table, and a spreadsheet is the right place to keep your own. What is worth copying is the SHAPE: access is a multiplier, not an addition, so the levers compound rather than add. PEX through easy access is $9,150 and copper through difficult access is $27,870 — 3.05x on the same house. Note the per-ft² figure FALLS as the house grows, because permit and drywall repair are fixed, so quoting a flat rate per square foot loses money on small jobs.

Water Heater Replacement Cost

One formula

Input cells

B2
— Equipment cost · example 1100 (50 gal gas)
B3
— Labour hours · B4 labour rate · example 4 · 110
B5
— Upgrades total · example 270 (expansion tank + pan)
B6
— Permit · B7 haul away · example 200 · 60
B8
— Regional factor · example 1.0

Paste into Excel

=B3*B4 labour =(B2+E2+B5+B6+B7)*B8 total =B2*B8/E3 equipment share of the job =E3*(1-0.18) band low =E3*(1+0.18) band high

Named-range version

=Hours*Rate =(Equipment+Labour+Upgrades+Permit+HaulAway)*Region =Equipment*Region/Total =Total*(1-0.18) =Total*(1+0.18)

The example returns

labour $440 → $2,070 total, equipment 53.1% of it, band $1,697–$2,443

This model bands at ±18%, not the ±15% every other cost formula here uses — water-heater jobs vary more than a repipe because what is behind the old unit is unknown until it comes out. Worth reproducing rather than tidying away. The upgrade cell is where a like-for-like swap turns into a project: a thermal expansion tank is required by IPC 607.3 on any closed system, and a gas tankless conversion typically adds a vent upgrade, a gas-line upsize and a condensate drain on top. The equipment-share cell is the useful one to show a customer — on a straight swap the box is barely half the bill, which is usually the opposite of what they expect.

Tables to paste

The 8 formulas above that need data

These are tab-separated. Copy one, click the cell you want it to start in, and paste — Excel, Google Sheets and LibreOffice all split it into columns automatically. Each is generated from the same code our calculators read, so it matches the tool exactly.

Hunter's curve — WSFU to GPM

IPC Appendix E Table E103.3(3), 37 rows. The flushometer column is blank at the low end because those fixtures cannot occur there. Appendix E is an appendix — enforceable only where specifically adopted — and Hunter's curve runs high for modern low-flow fixtures, so the error is toward larger pipe.

Fixture unitsFlush tank gpmFlushometer gpm
13
25
36.5
48
59.415
610.717.4
711.819.8
812.822.2
913.724.6
1014.627
121628.6
141730.2
161831.8
1818.833.4
2019.635
2521.538
3023.341
3524.943.8
4026.346.5
4527.749
5029.151.5
603255
703558.5
803862
904164.8
10043.567.5
1204872.5
14052.577.5
1605782.5
1806187
2006591.5
25075101
30085110
400105126
500124142
750170178
1000208208

Fitting equivalent lengths — L/D ratios

Equivalent feet is L/D × bore ÷ 12, so one table covers every pipe size. Overwrite the third column with your fitting counts and the developed-length SUMPRODUCT reads it directly. These are ASPE and manufacturer design values, not code.

FittingL/D ratioYour count
90 degree elbow300
45 degree elbow160
Tee, straight through200
Tee, through the branch600
Ball valve, full open80
Gate valve, full open80
Globe valve3400
Swing check valve1000

Minimum drain slope — IPC Table 704.1

Three rows is the entire table, which is why the nested IF above is honest rather than a shortcut. The last band has no upper size, so the IF ends with a bare else rather than a third comparison.

Up to size (in)Minimum slope (in/ft)Percent grade
2.50.252.08%
60.1251.04%
larger0.06250.52%

Trap arm maximum length — IPC Table 909.1

Measured from the trap weir to the inner edge of the vent fitting. At the three smallest sizes the arm has fallen exactly one pipe diameter at maximum length; at 3 and 4 in it has fallen half a diameter, because the permitted slope halves.

Trap arm size (in)Max slope (in/ft)Max developed length (ft)
1-1/4"0.255
1-1/2"0.256
2"0.258
3"0.12512
4"0.12516

Stocked vent sizes

Used by the vent-size MATCH to round the half-diameter result up to something you can buy. The 1.25 in first row is the IPC 916.2 floor.

Nominal size (in)
1-1/4"
1-1/2"
2"
2-1/2"
3"
4"
5"
6"
8"

Water density by temperature

Drives the thermal-expansion fraction. A uniform 10 °F grid from 40 to 200, so an approximate MATCH lands on the row below and the interpolation is straightforward. Note the 60 °F row is where the 0.4331 psi-per-foot constant comes from.

Temperature (°F)Density (lb/ft³)
4062.43
5062.41
6062.37
7062.3
8062.22
9062.12
10062
11061.86
12061.71
13061.55
14061.38
15061.2
16061.01
17060.79
18060.57
19060.35
20060.12

Fixture drainage units — IPC Table 709.1

28 fixtures. Overwrite the last column with your counts and SUMPRODUCT the DFU column against it. The blank trap cells are the fixtures with an integral trap — both bathroom groups, every water closet row and the urinals — where the trap is part of the fixture rather than a size you choose.

FixtureDFUTrap size (in)Your count
Bathroom group (1.6 gpf water closet)50
Bathroom group (over 1.6 gpf water closet)60
Water closet, private (1.6 gpf)30
Water closet, private (over 1.6 gpf)40
Lavatory11-1/4"0
Bathtub (with or without shower)21-1/2"0
Shower, up to 5.7 gpm21-1/2"0
Shower, over 5.7 to 12.3 gpm32"0
Kitchen sink, domestic21-1/2"0
Dishwashing machine, domestic21-1/2"0
Clothes washer, residential22"0
Laundry tray (1 or 2 compartments)21-1/2"0
Bidet11-1/4"0
Floor drain22"0
Sink21-1/2"0
Water closet, public (1.6 gpf)40
Water closet, public (over 1.6 gpf)60
Water closet, flushometer tank40
Urinal40
Urinal, 1 gpf or less20
Urinal, nonwater supplied0.50
Shower, over 12.3 to 25.8 gpm53"0
Shower, over 25.8 to 55.6 gpm64"0
Service sink21-1/2"0
Clothes washer, commercial32"0
Drinking fountain0.51-1/4"0
Wash sink (per faucet set)21-1/2"0
Dental lavatory11-1/4"0

Building drain capacity — IPC Table 710.1(1)

Maximum drainage fixture units on a building drain or sewer, by slope. Paste the blanks as genuinely empty cells — an empty cell compares as zero, so a first-TRUE capacity search skips those rows correctly, whereas a dash or the word 'n/a' breaks the comparison. Blank means the slope is not permitted at that size, not that capacity is unlimited.

Size (in)1/16 in/ft1/8 in/ft1/4 in/ft1/2 in/ft
1-1/4"11
1-1/2"33
2"2126
2-1/2"2431
3"364250
4"180216250
5"390480575
6"7008401000
8"1400160019202300
10"2500290035004200
12"3900460056006700
15"700083001000012000

Branches and stacks — IPC Table 710.1(2)

Use the column that matches what you are sizing — a horizontal branch, a short stack or a tall one. The counter-intuitive column is the last: a TALLER stack carries more per size than a short one, because terminal-velocity annular flow only develops with height. A 2 in stack takes 10 fixture units over three branch intervals and 24 over more than three.

Size (in)Horizontal branchStack, 3 intervals or fewerStack, over 3 intervals
1-1/2"348
2"61024
2-1/2"122042
3"204872
4"160240500
5"3605401100
6"6209601900
8"140022003600
10"250038005600
12"390060008400
15"7000

Septic tank minimums by bedroom count

Common published minimums rather than a single national code — septic falls to state and county health departments, so confirm the local figures before relying on these. The last row has no upper bedroom count, so a first-TRUE search rather than an exact match is the right lookup.

Up to bedroomsMinimum tank (gal)
31000
41250
51500
61750
more2000

Unit conversion factors

Every unit carries a factor to its category's base unit — gpm for flow, psi for pressure, gallons for volume, inches for length, ft/s for velocity. Multiply into the base and divide out of it. Temperature is deliberately absent: it is an offset scale, not a ratio, so it needs its own formula and cannot use this table.

CategoryUnitTo base
flowgpm1
flowgph0.016666666666666666
flowlpm0.26417205235814845
flowlps15.850323141488905
flowm3h4.402867539302474
flowcfs448.8312
flowukgpm1.200949925504855
pressurepsi1
pressureftH2O0.4331
pressuremH2O1.4209317585245
pressurebar14.503773773
pressurekpa0.1450377377
pressureatm14.695948775
volumegal1
volumel0.26417205235814845
volumeft37.48052
volumem3264.17205235814845
volumein30.004329004329004329
volumeukgal1.200949925504855
lengthin1
lengthft12
lengthmm0.03937007874015748
lengthcm0.39370078740157477
lengthm39.37007874015748
velocityfps1
velocityfpm0.016666666666666666
velocitymps3.280839895
velocitykph0.9113444152777778
Compatibility & rounding

Which Excel, and will the numbers match?

XLOOKUP needs a recent Excel

XLOOKUP arrived in Microsoft 365 and Excel 2021. Every lookup on this page is given in the INDEX / MATCH form as the pasteable version precisely because that form works in every Excel back to 2007, and in LibreOffice Calc unchanged. The named-range versions use XLOOKUP where it reads better. In Google Sheets the fallback is a courtesy rather than a necessity — there is no old version of Sheets, so everyone there already has XLOOKUP, LAMBDA, LET and named functions.

Exact match or approximate

The third argument of MATCH is not a detail. Use 0 for a listed size — a trap arm is 1-1/2 in or it is not. Use 1 for a curve you are reading between anchors, like Hunter's, and note that a 1 requires the lookup column to be sorted ascending, which every table here already is.

Rounding agrees with our calculators

Excel's ROUND rounds a half away from zero, which is the same rule our calculators display with. So =ROUND(23.615,2) gives 23.62 here and 23.62 there. Beware the other direction: some languages round a half to even and would give 23.61 on the same number. If a figure disagrees with a calculator by one in the last decimal, this is almost always why.

Working in Google Sheets?

Every formula on this page pastes into Sheets unchanged. What changes is the shape of the sheet you build around them: one ARRAYFORMULA governing a whole column instead of a formula per cell, QUERY instead of a pivot table, and named functions instead of a 189-character interpolation. Open the Google Sheets reference →

Constants here run to more digits

A few constants appear on the formula reference page in their familiar rounded form — 0.408 for velocity, 0.433 for head, 500 for the water-heating denominator. The formulas here use the fuller values our code actually runs on, 0.4085, 0.4331 and 499.8, so your sheet lands on the calculator's answer rather than near it. The difference is under a tenth of a percent in each case, and never changes a pipe size.

Sources & standards: International Plumbing Code (IPC) 2021 — 604.1, Table 604.3, 604.8, 607.1.2, 607.3, 704.1, Table 709.1, Tables 710.1(1) and 710.1(2), 906.2, Table 909.1, 916.2, and Appendix E Tables E103.3(2) and E103.3(3). Grease interceptor ratings follow PDI-G101. Gas figures come from the International Fuel Gas Code (IFGC) 402.4 and NFPA 54, which are a separate code from the IPC. Velocity limits, fitting equivalent lengths, and Hazen-Williams and Manning coefficients are ASPE and manufacturer design practice, not code requirements.

Plumbing code adoption is split: much of the country is on the IPC, while other states use the Uniform Plumbing Code (UPC), which differs on fixture-unit tables, drain slope allowances, and velocity limits. Confirm which code your jurisdiction has adopted, and which edition. Local amendments override the model code, and a licensed plumber plus the AHJ have final say on anything installed.

A spreadsheet is only as current as the day it was built. If you save a copy of these formulas and a table changes in a later code cycle, nothing in your file will tell you. That is the one real argument for working an answer here as well — the calculators are maintained against the code, and your copy is not.

Model it in a sheet. Quote it somewhere better.

A spreadsheet is the right tool for everything on this page — iterate a pipe size, sweep a temperature rise, work out what your bill rate has to be, or see what a 25% markup really delivers as margin. That is modelling, and a sheet is where it belongs. Producing the document a customer signs is a different job: it needs line items, versions and a record of what was agreed, and a workbook holding your price book starts going stale the day you save it. Model the numbers here, then let TradesQuote turn the scope into a line-item estimate your client can accept online.