Photo by Maxim Potyomkin on Unsplash
Why a spreadsheet model beats a gut-feel decision
Keeping aging equipment running can feel cheaper than buying new—until you add up unplanned downtime, rising energy bills, and escalating parts costs. Replacing a machine avoids those costs but requires upfront capital and may leave residual value on the old asset. A structured spreadsheet forces you to put every cost on the same timeline and discount future cash flows so a pound or dollar spent next year is correctly valued at less than one spent today.
This guide builds that model step by step, then publishes it as an interactive web calculator using the GSheetPress add-on. If you are new to building calculators with GSheetPress, the calculator feature overview explains how the add-on turns a Google Sheet into a shareable form without any coding.
Key terms explained
- Planning horizon: The number of years over which both options are compared. Both the repair path and the replacement path must cover the same number of years so the comparison is fair.
- Discount rate: The annual percentage used to reduce a future cost to its value in today's money. An 8% discount rate means 108 currency units payable in one year is worth 100 units today.
- Net present cost (NPC): The sum of all future costs, each reduced to today's value using the discount rate. Lower NPC means the cheaper option over the horizon.
- Residual value: The amount you expect to recover by selling or scrapping equipment at the end of the planning horizon. It is subtracted from costs because it is a future benefit.
- Downtime cost: The revenue or productivity lost per year because equipment is unavailable due to maintenance or breakdowns.
- Capital expenditure (CapEx): A one-off purchase cost paid now, at time zero, before discounting is applied.
- Annuity factor: A single multiplier that converts a stream of equal annual payments into a present value. For discount rate r (as a decimal) and horizon n years it equals (1 minus (1 plus r) to the power of negative n) divided by r.
- Salvage value: The same concept as residual value—the expected proceeds from disposing of the asset at the end of the horizon.
- Runtime input (G column): The value a user has actually typed into the web calculator form. GSheetPress writes these values to column G. Your formulas must read from G cells, not from column E which only holds defaults.
What this model covers and what it excludes
The model calculates the net present cost of two mutually exclusive options—repair the existing machine, or buy a replacement—over a user-defined horizon. It includes:
- A one-off repair cost or replacement purchase cost paid at time zero (no discounting needed for year-zero cash flows)
- Annual maintenance cost for each option, assumed constant across all years
- Annual energy cost saving achieved by switching to the newer, more efficient machine
- Annual downtime cost that applies to the repair option (older machines break down more often)
- Residual value of the new machine recovered at the end of the horizon, discounted back to today
The model excludes inflation adjustments (use a real discount rate if inflation affects both options equally), tax treatment of capital allowances, mid-life overhauls after the initial repair, and variable annual costs that change each year. For a year-by-year cost schedule displayed alongside your calculator, see the table feature. Verify your discount rate with your finance team; this guide uses 8% as an illustration only. The Wikipedia article on net present value explains the underlying discounting mathematics if you want a deeper reference.
Prerequisites
- A Google account with Google Sheets access.
- The GSheetPress add-on installed from the Google Workspace Marketplace. After installation, open a sheet and choose Extensions → GS2Web SaaS to confirm it appears in the menu.
- A GSheetPress account registered to the same Google address, with a Calculator entitlement active on your plan. Check your entitlement on the pricing page or log in at your account dashboard.
- A dedicated sample workbook created solely for this calculator. Never use a workbook that contains production financial records or personal data.
Build the equipment replacement calculator
This section creates the GSheetPress calculator template and then adds the helper formulas that perform the actual calculations. Work through the steps in order. Do not rearrange rows or columns in the generated template—the add-on relies on a fixed layout.
Step 1: Create the calculator template
- Open your dedicated sample workbook in Google Sheets.
- Click the tab you want to use, or add a new tab and name it RepairReplace.
- Choose Extensions → GS2Web SaaS → Calculator → New Calculator.
- When prompted, enter the calculator name: Equipment Repair vs Replace.
- When asked for the number of inputs, enter 9. Do not count the Calculate button as an input.
- When asked whether to include graphs, choose No unless you want an optional chart; the formulas below do not depend on that choice.
- Click OK or Create. The add-on generates headers in row 1 and blank rows for your inputs.
Step 2: Understand the generated layout
After creation, row 1 contains fixed column headers generated by the add-on. Do not edit them. The layout for nine inputs is:
| Row | Purpose |
|---|---|
| 1 | Generated headers: Labels, Input Type, Required, Data, Default, ToolTips, Inputs, Rules |
| 2–10 | Your nine input rows |
| 11 | Calculate button (generated; do not delete) |
| 12 | Merged result fields separator (generated) |
| 13 | Result column headings (you fill in) |
| 14 onward | Individual result rows (you fill in) |
Column G (headed Inputs) is where the web form writes the value a user submits. Column E (headed Default) holds the value pre-filled in the form. Your formulas must reference column G—not column E—because G is updated on every submission. Never store result formulas in column G.
Step 3: Configure the nine input rows
Fill in the cells below exactly as shown. Where a cell is described as blank, leave it empty—do not type anything in it. Column H is for validation rules; leave it blank for all inputs in this model.
Row 2 — Planning horizon
- A2 — Label: Planning Horizon (Years)
- B2 — Input Type: Number
- C2 — Required: Tick the checkbox so the field is mandatory
- D2 — Data: Leave blank
- E2 — Default: 10
- F2 — ToolTips: Number of years over which both options are compared. Must be the same for repair and replace.
- H2 — Rules: Leave blank
Row 3 — Discount rate
- A3 — Label: Discount Rate (%)
- B3 — Input Type: Number
- C3 — Required: Tick the checkbox
- D3 — Data: Leave blank
- E3 — Default: 8
- F3 — ToolTips: Enter as a whole number, e.g. 8 for 8%. Used to discount future costs to today's value.
- H3 — Rules: Leave blank
Row 4 — One-off repair cost
- A4 — Label: One-Off Repair Cost
- B4 — Input Type: Number
- C4 — Required: Tick the checkbox
- D4 — Data: Leave blank
- E4 — Default: 15000
- F4 — ToolTips: Total cost to repair or refurbish the existing machine today, including parts and labour.
- H4 — Rules: Leave blank
Row 5 — Replacement purchase price
- A5 — Label: Replacement Purchase Price
- B5 — Input Type: Number
- C5 — Required: Tick the checkbox
- D5 — Data: Leave blank
- E5 — Default: 60000
- F5 — ToolTips: Full purchase and installation cost of the new machine, paid now.
- H5 — Rules: Leave blank
Row 6 — Annual maintenance: repair option
- A6 — Label: Annual Maintenance Cost — Repair Option
- B6 — Input Type: Number
- C6 — Required: Tick the checkbox
- D6 — Data: Leave blank
- E6 — Default: 8000
- F6 — ToolTips: Expected average annual maintenance spend if you keep and repair the existing machine.
- H6 — Rules: Leave blank
Row 7 — Annual maintenance: replacement option
- A7 — Label: Annual Maintenance Cost — Replacement Option
- B7 — Input Type: Number
- C7 — Required: Tick the checkbox
- D7 — Data: Leave blank
- E7 — Default: 2000
- F7 — ToolTips: Expected average annual maintenance spend for the new replacement machine.
- H7 — Rules: Leave blank
Row 8 — Annual energy cost saving
- A8 — Label: Annual Energy Cost Saving from Replacement
- B8 — Input Type: Number
- C8 — Required: Tick the checkbox
- D8 — Data: Leave blank
- E8 — Default: 3000
- F8 — ToolTips: Annual reduction in energy spend achieved by switching to the new machine. Enter 0 if no saving is expected.
- H8 — Rules: Leave blank
Row 9 — Annual downtime cost
- A9 — Label: Annual Downtime Cost — Repair Option
- B9 — Input Type: Number
- C9 — Required: Tick the checkbox
- D9 — Data: Leave blank
- E9 — Default: 5000
- F9 — ToolTips: Annual cost of lost production or revenue due to breakdowns on the existing machine. Assumed zero for the new machine.
- H9 — Rules: Leave blank
Row 10 — Residual value of new machine
- A10 — Label: Residual Value of New Machine at End of Horizon
- B10 — Input Type: Number
- C10 — Required: Tick the checkbox
- D10 — Data: Leave blank
- E10 — Default: 10000
- F10 — ToolTips: Expected sale or scrap value of the replacement machine at the end of the planning horizon. Enter 0 if unknown.
- H10 — Rules: Leave blank
Step 4: Confirm the generated button and separator rows
Row 11 is the Calculate button, generated automatically. Check that:
- A11 contains the label Calculate (or your chosen button text).
- B11 shows Button.
- D11 shows main.
- E11 shows Reset — this is the reset button label, not an input default. Do not change it.
Row 12 is the merged result fields separator, also generated. Leave it untouched.
Step 5: Add result headings in row 13
Click cell A13 and type Result. Click cell B13 and type Value. These become the column headings displayed above your results on the published calculator.
Step 6: Add helper formulas in a separate block
Place the calculation engine in column J, well clear of the template columns A through H. These cells compute the answers that your result rows in column B will display.
Click cell J1 and type the label Annuity Factor. Click cell J2 and enter this formula exactly, including the leading equals sign, then press Enter:
=IF(G3=0, G2, (1-(1+G3/100)^(-G2))/(G3/100))
This formula reads the discount rate from G3 and the horizon from G2. If the user enters 0 as a discount rate (meaning no time value of money), the annuity factor simply equals the number of years. Otherwise it applies the standard present-value annuity formula. The ^ symbol means "to the power of".
Click cell K1 and type Repair NPC. Click cell K2 and enter:
=G4 + (G6+G9)*J2
This adds the upfront repair cost (G4, paid today so not discounted) to the present value of the annual maintenance and downtime costs for the repair option, multiplied by the annuity factor in J2.
Click cell L1 and type Replace NPC. Click cell L2 and enter:
=G5 + G7*J2 - G8*J2 - G10*(1+G3/100)^(-G2)
This adds the purchase price (G5, paid today) plus the present value of replacement maintenance (G7 times J2), then subtracts the present value of annual energy savings (G8 times J2) and the present value of the residual value (G10 discounted back over G2 years at G3%).
Click cell M1 and type Net Saving. Click cell M2 and enter:
=K2-L2
A positive result means repair has a higher NPC than replacement, so replacement is the cheaper option. A negative result means repair is cheaper.
Click cell N1 and type Decision. Click cell N2 and enter:
=IF(M2>0,"Replace — saves "&TEXT(M2,"#,##0"),IF(M2<0,"Repair — saves "&TEXT(-M2,"#,##0"),"Both options have equal NPC"))
This produces a plain-English label that the result rows will display.
Step 7: Add result rows starting at row 14
Column A holds the result label; column B holds the formula that pulls from your helper block. Click each cell, type the value shown, and press Enter.
| Cell | Column A — Label | Cell | Column B — Formula or value |
|---|---|---|---|
| A14 | Annuity Factor | B14 | =J2 |
| A15 | Repair Option — Net Present Cost | B15 | =K2 |
| A16 | Replace Option — Net Present Cost | B16 | =L2 |
| A17 | Net Saving from Preferred Option | B17 | =ABS(M2) |
| A18 | Recommended Decision | B18 | =N2 |
Step 8: Test the formulas before publishing
At this stage the web form has not been used, so column G is empty and your formulas will show errors or zeros. To test with the defaults from column E, do the following:
- Select cells E2:E10.
- Press Ctrl+C (or Cmd+C on Mac) to copy.
- Click cell G2.
- Choose Edit → Paste special → Values only and confirm. This pastes the numbers without overwriting the template structure.
- Check that the helper cells in J2, K2, L2, M2, and N2 now show numbers rather than errors.
With the default values supplied in this guide (horizon 10 years, discount rate 8%, repair cost 15,000, purchase price 60,000, repair maintenance 8,000, replacement maintenance 2,000, energy saving 3,000, downtime cost 5,000, residual value 10,000), you should see these figures:
| Result field | Expected value |
|---|---|
| Annuity Factor (J2) | 6.710 |
| Repair NPC (K2) | 15,000 + (8,000 + 5,000) × 6.710 = 15,000 + 87,230 = 102,230 |
| Replace NPC (L2) | 60,000 + 2,000 × 6.710 − 3,000 × 6.710 − 10,000 × (1.08)^(−10) = 60,000 + 13,420 − 20,130 − 4,632 = 48,658 |
| Net Saving (M2) | 102,230 − 48,658 = 53,572 |
| Decision (N2) | Replace — saves 53,572 |
Minor rounding differences of a few units are normal because Google Sheets carries more decimal places internally. If J2 returns a divide-by-zero error, check that G3 is not empty—paste the default value 8 into G3 manually. If K2 or L2 returns an error, verify that all G2 through G10 cells contain numbers, not text or blank cells.
Step 9: Alternative scenario check
To confirm the model handles a repair-favourable scenario correctly, temporarily paste these values into G2:G10 (using Paste special → Values only as before): horizon 5, discount rate 8%, repair cost 5,000, purchase price 60,000, repair maintenance 6,000, replacement maintenance 4,000, energy saving 1,000, downtime cost 1,000, residual value 5,000.
Expected results: annuity factor approximately 3.993; repair NPC approximately 5,000 + (6,000+1,000) × 3.993 = 32,951; replace NPC approximately 60,000 + 4,000 × 3.993 − 1,000 × 3.993 − 5,000 × (1.08)^(−5) = 60,000 + 15,972 − 3,993 − 3,403 = 68,576; net saving approximately 68,576 − 32,951 = 35,625 in favour of repair. The decision cell should read Repair — saves 35,625. Restore the original defaults to G2:G10 before publishing.
Frequently asked questions
Can I use this model for more than two options?
The current build compares exactly one repair scenario against one replacement scenario. To add a third option—for example, a leased machine—add another helper column (say O2) with its NPC formula using the same G2 (horizon) and J2 (annuity factor), then add a result row that references O2. You would also need to update the decision logic in N2 to compare all three values using nested IF statements or a MIN function combined with an INDEX/MATCH lookup.
Should I enter the discount rate as 8 or 0.08?
Enter it as a whole number, for example 8 for 8%. The formulas in this guide divide G3 by 100 internally (G3/100), so entering 0.08 would give a rate of 0.08%, which is far too low and would produce misleading results. The tooltip on the discount rate input field reminds users to enter a whole number.
What if the existing machine has a residual value too?
This model assumes the existing machine has zero residual value at the end of the horizon, which is conservative and common for aging equipment. If your existing machine would still fetch a sale price at the end of the period, subtract that amount from the repair NPC by modifying the formula in K2. For example, if G11 held the existing machine's residual value, the formula would become:
=G4 + (G6+G9)*J2 - G11*(1+G3/100)^(-G2)
You would need to add G11 as a tenth input row (row 11 would shift the button and all subsequent rows down by one), which requires creating a new calculator with ten inputs rather than nine.
Troubleshooting
Formulas show #DIV/0! or #VALUE!
This usually means one or more G cells are empty or contain text. Confirm that G2 through G10 all contain numbers. If you have not yet submitted the web form, paste the defaults from E2:E10 into G2:G10 using Paste special → Values only. Never type text such as "n/a" into a G cell that a formula references.
The annuity factor in J2 looks wrong
Double-check that G3 holds the rate as a whole number (8, not 0.08) and G2 holds a positive integer for the number of years. A horizon of zero would make the annuity factor zero and give misleading results; add a note in your planning to always use a horizon of at least one year.
The result rows in column B show the formula text instead of a number
This happens when a cell is formatted as Plain text before you enter the formula. Click the affected cell, choose Format → Number → Automatic, then delete the cell contents, retype the formula starting with =, and press Enter.
The published calculator does not update when I change the spreadsheet formulas
After editing formulas in the sheet, you must republish the calculator. Go to Extensions → GS2Web SaaS → Calculator → Publish Calculator, select the existing calculator by name, and confirm. Republishing the same calculator retains its existing public link—you do not need to update any website embed code.
Column G values look correct but results are still wrong
Verify that your helper formulas in J2, K2, L2, M2, and N2 reference the correct G row numbers. It is easy to accidentally reference G2 when you meant G5 if you inserted or deleted rows after writing the formulas. Click each helper cell and read the formula bar carefully.
Publish and test your web calculator
Before publishing, restore the original default values to G2:G10 by pasting E2:E10 there using Paste special → Values only. This ensures the published calculator displays sensible pre-filled values when a user first opens it.
Step 1: Share the spreadsheet correctly
- Click the Share button in the top-right corner of your Google Sheet.
- Under General access, change the setting to Anyone with the link.
- Set the role to Editor.
- Click Done.
Important: Setting access to Editor means anyone who holds the spreadsheet URL can modify the sheet. This is a current requirement of the GSheetPress publishing process. Use only your dedicated sample workbook—never a file containing real financial or personal data. If you need to restrict who can submit the form, manage access through the published calculator's sharing settings in the GSheetPress dashboard rather than through the spreadsheet itself.
Step 2: Publish the calculator
- Make sure you are on the RepairReplace tab (the tab containing the calculator template).
- Choose Extensions → GS2Web SaaS → Calculator → Publish Calculator.
- Select Equipment Repair vs Replace from the list of calculators associated with your account.
- Confirm and wait for the success message. This may take a few seconds.
Step 3: Find and open the public link
- Choose Extensions → GS2Web SaaS → Calculator → Get Links (or the equivalent link-refresh option in your version). This opens or refreshes a sheet listing your published calculators.
- Find the row where the Sheet Name column matches RepairReplace and the calculator name matches Equipment Repair vs Replace.
- Open the URL in column C (the public Link). Do not use column B (Edit Link), which opens the back-end editor.
- If you want to embed the calculator on a website, copy the iframe code from column D and paste it into an HTML block on your page.
Step 4: Test the published calculator
- On the public calculator page, confirm that all nine input fields appear with the correct labels and default values.
- Enter the worked example values: horizon 10, discount rate 8, repair cost 15000, purchase price 60000, repair maintenance 8000, replacement maintenance 2000, energy saving 3000, downtime cost 5000, residual value 10000.
- Click the Calculate button.
- Confirm the results match the expected values from Step 8 above: repair NPC approximately 102,230; replace NPC approximately 48,658; recommended decision Replace — saves approximately 53,572.
- Click Reset and confirm the fields return to their default values.
If the numbers on the public page differ from your spreadsheet, return to the sheet, check that G2:G10 contain the same values you entered on the form, and republish. For further help with publishing or account issues, visit the GSheetPress support page.