
To calculate MTTR and MTBF in Excel, build a table with one row per downtime event, turn each event into hours with =(back_online-stopped)*24, add the corrective hours with =SUMIF, count the failures with =COUNTIF and divide one by the other. Two cells give you both indicators.
Below is the whole spreadsheet: the columns of the downtime table, the formulas cell by cell, the worked example with the numbers from the table and the formatting mistakes that make the result wrong.
How to calculate MTTR and MTBF in Excel step by step
- One row per downtime event. Every stop of the equipment is a row, with type, start and end.
- One calculated hours column. The difference between the two timestamps, multiplied by 24, gives the downtime in hours.
- Separate corrective from planned. MTTR only counts failure repairs; preventive work and inspections stay out of the repair sum and out of the failure count.
- One cell with the scheduled hours of the period. It is the time the equipment was supposed to run, not the 720 calendar hours when the operation runs two shifts.
- Four result cells. Total repair time, number of failures, MTTR and MTBF, in that order.
- One availability cell. MTBF divided by the sum of MTBF and MTTR.
What each indicator means and what belongs in the calculation is in MTTR and MTBF: formulas and how to calculate them.
The downtime table
The table below is an illustration, with the stops of one pump in a 30-day month of continuous operation. The data sits in columns A to E, rows 2 to 6.
| Row | A: Equipment | B: Type | C: Stopped | D: Back online | E: Downtime hours |
|---|---|---|---|---|---|
| 2 | P-101 | Corrective | Mar 3, 08:00 | Mar 3, 11:00 | 3.0 |
| 3 | P-101 | Preventive | Mar 8, 07:00 | Mar 8, 13:00 | 6.0 |
| 4 | P-101 | Corrective | Mar 12, 14:30 | Mar 12, 19:30 | 5.0 |
| 5 | P-101 | Corrective | Mar 19, 09:00 | Mar 19, 11:30 | 2.5 |
| 6 | P-101 | Corrective | Mar 26, 16:00 | Mar 26, 17:30 | 1.5 |
Columns C and D hold date and time in the same cell, formatted as date and time. Column B uses two fixed words, picked from a data validation list, because the result formulas look for the exact text. One equipment per sheet, or an equipment column you filter, keeps you away from a plant-wide average.
The MTTR and MTBF formulas in Excel, cell by cell
Column E is calculated. In E2, dragged down to E6:
=(D2-C2)*24
Excel stores date and time as a number of days, so the difference comes out in days and multiplying by 24 converts it into hours. Format column E as a number with one decimal place, never as time.
The result cells sit in column H, with the labels in column G. The scheduled hours of the period are typed into H2 (720 in the example).
| Cell | Label in G | Formula in H | What it does |
|---|---|---|---|
| H3 | Total repair time | =SUMIF($B$2:$B$6,"Corrective",$E$2:$E$6) | Adds the hours of the corrective rows only |
| H4 | Number of failures | =COUNTIF($B$2:$B$6,"Corrective") | Counts how many corrective events happened |
| H5 | MTTR in hours | =IFERROR(H3/H4,"") | Total repair time divided by the number of failures |
| H6 | Operating time | =H2-SUM($E$2:$E$6) | Scheduled hours minus every downtime hour, corrective and planned |
| H7 | MTBF in hours | =IFERROR(H6/H4,"") | Operating time divided by the number of failures |
| H8 | Availability | =IFERROR(H7/(H7+H5),"") | Format the cell as a percentage |
The IFERROR keeps #DIV/0! away in a month with no failure: the cell stays empty instead of showing an error. If your Excel uses a semicolon to separate function arguments, replace the commas in the formulas above.
For ranges that grow, turn A1:E6 into a table (Insert, Table) and replace the fixed addresses with the column names: the formula then picks up new rows with no adjustment.
Worked example with the numbers from the table
- H3, total repair time: 3.0 + 5.0 + 2.5 + 1.5 = 12 hours. The 6-hour preventive is left out.
- H4, number of failures: 4 corrective events.
- H5, MTTR: 12 ÷ 4 = 3 hours per repair.
- H6, operating time: 720 − 18 (12 corrective plus 6 preventive) = 702 hours.
- H7, MTBF: 702 ÷ 4 = 175.5 hours between failures.
- H8, availability: 175.5 ÷ (175.5 + 3) = 98.3%.
If the preventive hours were added to the repair time, MTTR would be 18 ÷ 5 = 3.6 hours, and the team would look 20% slower with nothing changed in execution. That is why the type column comes before any formula.
A ready file with the three calculations per equipment is the MTTR, MTBF and availability spreadsheet in Excel.
Tracking month by month in the same file
A single month shows no trend, and on equipment that rarely fails one extra failure moves the average a lot. Two ways to see the series without duplicating the file:
- A month column in the downtime table. Add column F with
=TEXT(C2,"yyyy-mm")and swapSUMIFforSUMIFS, with the month as a second criterion. The count becomesCOUNTIFS. - A PivotTable over the downtime rows. Month in rows, type in columns, sum of hours in values. Monthly MTTR comes from dividing the two columns in a calculated field.
Keep the same start and end criteria across all months. Changing the rule mid-year moves the indicator with nothing changed in the repair. The full indicator set is in the maintenance KPI guide, and the third indicator people mix in is explained in what MTTF is and how to calculate it.
Mistakes that make the spreadsheet wrong
- Timestamps typed as text. If the cell aligns to the left, Excel did not read a date and the subtraction returns
#VALUE!. Type in the date format of your regional setting. - Column E formatted as time. In a time format, 12 hours show up as 12:00 and a sum above 24 hours rolls into a day. Use a number format.
- The type written in different ways. "Corrective", "corrective " with a trailing space and "Corr." are three different strings, and
COUNTIFonly counts exact matches. Use a data validation list. - Back online before the stop. The difference goes negative and passes silently; conditional formatting on
=D2<C2catches it. - Calendar time instead of scheduled hours. On a two-shift operation, using 720 hours nearly doubles the MTBF.
- Fixed ranges that do not follow new rows. A row pasted below E6 stays out of the formula. An Excel table solves it.
- Production stops logged as failures. No raw material and product changeovers are neither repair nor equipment failure.
When the spreadsheet stops being enough
A spreadsheet handles one equipment, one month and one criterion. It starts to get in the way when the stop time is typed from memory at the end of the shift, when two analysts keep different versions of the same file, or when the plant goes past a few dozen assets. At that point the indicator has to come out of the work order record instead of a later keystroke: the effect of delayed reporting is measured in late reporting and maintenance KPIs, and the role of a system that keeps that history is in what a CMMS is.
Frequently asked questions about MTTR and MTBF in Excel
What is the MTTR formula in Excel?
With the downtime type in column B and the hours in column E, MTTR is =SUMIF($B$2:$B$6,"Corrective",$E$2:$E$6)/COUNTIF($B$2:$B$6,"Corrective"): repair hours divided by the number of corrective events.
What is the MTBF formula in Excel?
With the scheduled hours in H2, MTBF is =(H2-SUM($E$2:$E$6))/COUNTIF($B$2:$B$6,"Corrective"): operating time divided by the number of failures.
How do I turn timestamps into downtime hours in Excel?
Subtract the stop from the return and multiply by 24: =(D2-C2)*24. The result is the number of hours, and the cell has to be formatted as a number.
How do I calculate availability in the same file?
With MTBF in H7 and MTTR in H5, use =H7/(H7+H5) and format the cell as a percentage. In the example, 175.5 ÷ (175.5 + 3) gives 98.3%.
How do I avoid the #DIV/0! error when there was no failure?
Wrap the division in IFERROR: =IFERROR(H3/H4,""). In a month with no corrective event the cell stays empty instead of showing an error.
Do preventive stops count in the calculation?
They stay out of the repair time and out of the failure count, but they also come out of the MTBF operating time. That is why the H6 formula subtracts every downtime hour while H3 adds only the corrective ones.
Can I calculate MTTR and MTBF for several equipment in the same file?
Yes. Keep the equipment in column A, swap SUMIF for SUMIFS and COUNTIF for COUNTIFS, with equipment and type as criteria, and repeat the result cells per asset.
The numbers in the spreadsheet are worth what the typed hour is worth. With PM Run, the technician opens the notification with the machine down and records start, end and cause during execution, on the phone and integrated with SAP PM; the data arrives ready for you to build your own maintenance KPI dashboard with MTTR and MTBF by equipment and class, with no spreadsheet in between.
