About this template
How long will my UPS last, and how big a battery do I need? With efficiency, depth of discharge and battery ageing.
What you get: Excel calculator (example + blank): load list with duty cycle, VA and load % check, battery Wh, usable Wh, runtime in hours/minutes, target runtime to required Wh/Ah/extra batteries, yearly kWh; Python CLI; 9 workbook tests + 7 script tests.
Who it is for: Anyone protecting a NAS, router, switch or small server with a UPS or a DIY battery backup.
Files:
- `ups-runtime-calculator-BLANK.xlsx`
- `ups-runtime-calculator-EXAMPLE.xlsx`
- `ups_calc.py`
How to use: open the EXAMPLE file first to see every formula working (yellow cells = your inputs, blue-grey = formulas); then use the BLANK file for your own data. See Start_here sheet / included notes. Test examples are in the Tests sheet or `--selftest` where included.
What it is NOT: Not a replacement for the maker's runtime chart: real runtime is non-linear. Not a safety certification for DIY battery systems.
Questions
What file types do I get?
Two Excel files (.xlsx), one filled-in EXAMPLE and one BLANK, plus a Python script (ups_calc.py). README.md and SOURCES.md are also included.
Can I edit the formulas?
Yes. The workbook has 53 formulas across 3 sheets. Yellow cells are your inputs and blue-grey cells are formulas, so you can see what to change and what is calculated.
How do I start, and does it replace the maker's runtime chart?
Open the EXAMPLE file first to see every formula working, then enter your own data in the BLANK file. It does not replace the maker's runtime chart, because real runtime is non-linear. Use it as a planning estimate and check it against the manufacturer's data.



