Skip to main content

FMEA Risk Priority Number (RPN) Calculations

The RPN formula is the foundational calculation in Failure Mode and Effects Analysis, combining three severity dimensions into a single risk score:

Initial RPN (Before Mitigations)

formulas.commonRpn = function(info) {
  var occ = info.item['occurrence'];      // Occurrence rating (1-10)
  var sev = info.item['severity'];        // Severity rating (1-10)
  var det = info.item['detection'];       // Detection rating (1-10)
  
  var value = occ * sev * det;  // Multiply all three factors
  return value ? value : null;   // Return null if any factor is zero
}
RPN Range: 1-1000
Risk Categories:
  • 1-150: Low risk (green) — Monitor only
  • 151-350: Medium risk (yellow) — Plan mitigations
  • 351-1000: High risk (red) — Immediate action required

Revised RPN (After Mitigation Actions)

formulas.commonRpnNew = function(info) {
  var occNew = info.item['occNew'];        // Revised occurrence
  var sevNew = info.item['sevNew'];        // Revised severity
  var detNew = info.item['detNew'];        // Revised detection
  
  var value = occNew * sevNew * detNew;
  return value ? value : null;
}
This formula evaluates the effectiveness of mitigation actions by recalculating RPN with improved severity metrics.

RPN Risk Classification

formulas.riskClassification = function(info) {
  var rpn = info.item['rpn'];  // Reference the initial RPN calculation
  
  if (rpn > 350) {
    return 'Critical';
  } else if (rpn > 150) {
    return 'Moderate';
  } else if (rpn > 0) {
    return 'Low';
  }
  return null;  // Empty if RPN not calculated
}

HARA (Hazard Analysis and Risk Assessment) Formulas

HARA workflows use different severity metrics suited to safety-critical systems:

Severity-Controllability Matrix

formulas.hara_severity = function(info) {
  var exposure = info.item['exposure'];      // E: Exposure (1-5)
  var severity = info.item['hazardSev'];     // S: Hazard severity (1-4)
  var controllability = info.item['control']; // C: Controllability (1-3)
  
  // ASIL (Automotive Safety Integrity Level) calculation
  var asil = exposure * severity / controllability;
  return asil ? Math.round(asil * 10) / 10 : null;  // Round to 1 decimal
}

Safety Integrity Level (ASIL) Assignment

formulas.asil_rating = function(info) {
  var asil = info.item['asil'];
  
  if (asil >= 10) return 'ASIL D';    // Highest safety level
  if (asil >= 6) return 'ASIL C';
  if (asil >= 3) return 'ASIL B';
  if (asil > 0) return 'ASIL A';
  return 'No ASIL';  // Non-safety relevant
}

Impact and Probability Scoring

Priority Matrix (Probability × Impact)

formulas.priority_score = function(info) {
  var probability = info.item['probability'];  // 1-5 scale
  var impact = info.item['impact'];            // 1-5 scale
  
  return probability * impact;  // Results range 1-25
}
Priority Zones:
  • 1-5: Low priority (green) — Track, no action
  • 6-12: Medium priority (yellow) — Schedule mitigation
  • 13-25: High priority (red) — Urgent action

Risk Score with Weighted Factors

formulas.weighted_risk = function(info) {
  var likelihood = info.item['likelihood'] || 0;   // 40% weight
  var consequence = info.item['consequence'] || 0;  // 35% weight
  var detectability = info.item['detectability'] || 0;  // 25% weight
  
  var score = (likelihood * 0.4) + (consequence * 0.35) + (detectability * 0.25);
  return score ? Math.round(score) : null;
}

Conditional Risk Escalation

Multi-Condition Risk Assessment

formulas.escalation_flag = function(info) {
  var severity = info.item['severity'];
  var duration = info.item['duration_days'];
  var affected_users = info.item['user_count'];
  
  // Escalate if multiple risk factors present
  if (severity >= 8 && duration > 7) {
    return 'Escalate';
  }
  if (severity >= 7 && affected_users > 100) {
    return 'Escalate';
  }
  if (duration > 30) {
    return 'Escalate';
  }
  
  return null;  // No escalation needed
}

Status-Based Action Trigger

formulas.action_required = function(info) {
  var status = info.item['status'];
  var reviewed = info.item['reviewed'];
  var approved = info.item['approved'];
  
  if (status == 'Open' && !reviewed) {
    return 'Pending Review';
  }
  if (reviewed && !approved) {
    return 'Pending Approval';
  }
  if (status == 'Open' && approved) {
    return 'Ready for Implementation';
  }
  
  return status;  // Default to current status
}

Cost and Resource Calculations

Mitigation Cost per Risk Point

formulas.cost_effectiveness = function(info) {
  var cost = info.item['mitigation_cost'];  // In currency units
  var rpn_reduction = info.item['rpn'] - info.item['rpnNew'];  // Before/after RPN
  
  if (rpn_reduction > 0) {
    return Math.round((cost / rpn_reduction) * 100) / 100;  // Cost per RPN point
  }
  return null;  // Invalid if no improvement
}

Resource Allocation Index

formulas.resource_priority = function(info) {
  var effort_hours = info.item['estimated_effort'];
  var team_capacity = info.item['team_hours_available'];
  var risk_score = info.item['rpn'];
  
  // Risk score weighted by effort requirements
  var priority = risk_score / (effort_hours + 1);  // +1 to avoid division by zero
  return Math.round(priority);
}

Date and Timeline Calculations

Days Since Risk Identified

formulas.days_open = function(info) {
  var identified_date = new Date(info.item['identified_date']);
  var today = new Date();
  
  if (!identified_date || isNaN(identified_date)) {
    return null;
  }
  
  var diff = today - identified_date;
  var days = Math.floor(diff / (1000 * 60 * 60 * 24));  // Convert ms to days
  return days >= 0 ? days : null;
}

Overdue Mitigation Flag

formulas.overdue_status = function(info) {
  var due_date = new Date(info.item['mitigation_due_date']);
  var today = new Date();
  var status = info.item['status'];
  
  if (status == 'Completed' || status == 'Closed') {
    return null;  // Not overdue if already completed
  }
  
  if (due_date < today) {
    var days = Math.floor((today - due_date) / (1000 * 60 * 60 * 24));
    return days + ' days overdue';
  }
  
  return null;  // On track
}

Formula Execution Pattern

diagram

Data Completeness Checks

Warn When Required Fields Missing

formulas.data_completeness = function(info) {
  var missing = 0;
  
  if (!info.item['severity']) missing++;
  if (!info.item['occurrence']) missing++;
  if (!info.item['detection']) missing++;
  if (!info.item['mitigation_plan']) missing++;
  
  if (missing > 0) {
    return missing + ' fields incomplete';
  }
  return 'Complete';
}

Validation Status Summary

formulas.validation_status = function(info) {
  var validations = {
    has_rpn: info.item['rpn'] && info.item['rpn'] > 0,
    has_mitigation: info.item['mitigation_plan'] && info.item['mitigation_plan'].length > 0,
    has_owner: info.item['owner'] != null && info.item['owner'] != '',
    has_deadline: info.item['due_date'] != null
  };
  
  var passCount = Object.values(validations).filter(v => v).length;
  return passCount + '/4 validations passed';
}

Null Handling Best Practices

The formula framework treats null specially: it displays the cell as empty rather than showing “0” or “undefined”. This is essential for FMEA where a missing RPN component should not display as zero risk.
// Good: Returns null when data unavailable
formulas.example_good = function(info) {
  if (!info.item['factor1'] || !info.item['factor2']) {
    return null;  // Missing data → empty cell
  }
  return info.item['factor1'] * info.item['factor2'];
}

// Avoid: Returns 0 for missing data
formulas.example_bad = function(info) {
  return (info.item['factor1'] || 0) * (info.item['factor2'] || 0);
  // This masks incomplete data with zero values
}

Testing Your Formulas

  1. Use the browser console to test formula logic before configuring in risksheet.json
  2. Populate test rows with known values and verify calculated results
  3. Check edge cases: zero values, missing fields, negative numbers, very large numbers
  4. Monitor performance with formulas on thousands of rows
  5. Verify type coercion with mixed data types (strings vs numbers)

See Also

Source Code
  • AppConfig.ts
  • AppConfigHelper.ts
  • risksheet.json
  • CellPreviewFormatter.ts
  • PolarionAppConfigManager.java