Lesson 13 of 30 ~15 min
Course progress
0%

ROI Calculation

Jak spočítat návratnost investice do Claude.

Přesná ROI kalkulace je klíčová pro obhájení investice do AI nástrojů.

ROI Formula

ROI = (Gains - Costs) / Costs × 100%

Kde:
Gains = Time Saved × Hourly Rate + Quality Improvements + Other Benefits
Costs = API Costs + Training Time + Infrastructure

Detailní kalkulace

Cost Side

class AICostCalculator:
    def __init__(
        self,
        hourly_rate: float = 75,  # Developer hourly rate
        training_hours: float = 8,  # Per person
        num_users: int = 10
    ):
        self.hourly_rate = hourly_rate
        self.training_hours = training_hours
        self.num_users = num_users
    
    def monthly_costs(
        self,
        api_spend: float,
        infrastructure: float = 0
    ) -> dict:
        # One-time training cost (amortized over 12 months)
        training_cost = (self.training_hours * self.hourly_rate * self.num_users) / 12
        
        return {
            "api_costs": api_spend,
            "infrastructure": infrastructure,
            "training_amortized": training_cost,
            "total": api_spend + infrastructure + training_cost
        }

Benefit Side

class AIBenefitCalculator:
    def __init__(self, hourly_rate: float = 75):
        self.hourly_rate = hourly_rate
    
    def monthly_benefits(
        self,
        hours_saved: float,
        bugs_prevented: int = 0,
        bug_cost: float = 500,  # Average cost to fix a bug
        additional_revenue: float = 0
    ) -> dict:
        time_value = hours_saved * self.hourly_rate
        quality_value = bugs_prevented * bug_cost
        
        return {
            "time_savings": time_value,
            "quality_improvements": quality_value,
            "additional_revenue": additional_revenue,
            "total": time_value + quality_value + additional_revenue
        }

Příklad: 10-person Dev Team

# Setup
team_size = 10
hourly_rate = 75  # $75/hour
working_days = 20  # per month

# Costs
api_spend = 500  # $500/month for team
training = 8 * hourly_rate * team_size / 12  # Amortized

total_costs = api_spend + training  # $500 + $500 = $1000/month

# Benefits
hours_saved_per_person_per_day = 1.5  # Conservative estimate
monthly_hours_saved = hours_saved_per_person_per_day * working_days * team_size
# = 1.5 * 20 * 10 = 300 hours/month

time_value = monthly_hours_saved * hourly_rate
# = 300 * $75 = $22,500/month

bugs_prevented = 5  # per month
bug_value = 5 * 500  # = $2,500/month

total_benefits = time_value + bug_value  # = $25,000/month

# ROI
roi = (total_benefits - total_costs) / total_costs * 100
# = ($25,000 - $1,000) / $1,000 * 100 = 2400%

payback_period = total_costs / total_benefits  # months
# = $1,000 / $25,000 = 0.04 months = ~1 day

ROI Calculator

def calculate_roi(
    team_size: int,
    hourly_rate: float,
    hours_saved_per_day: float,
    monthly_api_cost: float,
    bugs_prevented: int = 0,
    bug_cost: float = 500
) -> dict:
    # Monthly costs
    training_amortized = (8 * hourly_rate * team_size) / 12
    total_costs = monthly_api_cost + training_amortized
    
    # Monthly benefits
    working_days = 20
    monthly_hours_saved = hours_saved_per_day * working_days * team_size
    time_value = monthly_hours_saved * hourly_rate
    quality_value = bugs_prevented * bug_cost
    total_benefits = time_value + quality_value
    
    # ROI metrics
    net_benefit = total_benefits - total_costs
    roi_percent = (net_benefit / total_costs) * 100
    
    return {
        "costs": {
            "api": monthly_api_cost,
            "training": training_amortized,
            "total": total_costs
        },
        "benefits": {
            "time_savings": time_value,
            "quality": quality_value,
            "total": total_benefits
        },
        "roi": {
            "net_monthly_benefit": net_benefit,
            "roi_percent": roi_percent,
            "annual_value": net_benefit * 12,
            "payback_days": (total_costs / total_benefits) * 30
        }
    }

# Příklad použití
result = calculate_roi(
    team_size=10,
    hourly_rate=75,
    hours_saved_per_day=1.5,
    monthly_api_cost=500,
    bugs_prevented=5
)

print(f"Monthly ROI: {result['roi']['roi_percent']:.0f}%")
print(f"Annual Value: ${result['roi']['annual_value']:,.0f}")
print(f"Payback Period: {result['roi']['payback_days']:.1f} days")

Sensitivity Analysis

def sensitivity_analysis(base_case: dict) -> dict:
    """Test různé scénáře"""
    
    scenarios = {
        "conservative": {
            "hours_saved_per_day": base_case["hours_saved"] * 0.5,
            "bugs_prevented": base_case["bugs"] * 0.5
        },
        "base": base_case,
        "optimistic": {
            "hours_saved_per_day": base_case["hours_saved"] * 1.5,
            "bugs_prevented": base_case["bugs"] * 1.5
        }
    }
    
    results = {}
    for name, scenario in scenarios.items():
        roi = calculate_roi(**scenario)
        results[name] = roi["roi"]["roi_percent"]
    
    return results

# Příklad
analysis = sensitivity_analysis({
    "team_size": 10,
    "hourly_rate": 75,
    "hours_saved": 1.5,
    "monthly_api_cost": 500,
    "bugs": 5,
    "bug_cost": 500
})

# Output:
# Conservative: 1100%
# Base: 2400%
# Optimistic: 3700%

Break-even Analysis

def break_even_hours(
    monthly_api_cost: float,
    hourly_rate: float,
    team_size: int,
    working_days: int = 20
) -> float:
    """Kolik hodin musí tým ušetřit aby se investice vyplatila"""
    
    # Break-even: Benefits = Costs
    # hours_saved * hourly_rate = monthly_api_cost + training
    
    training_amortized = (8 * hourly_rate * team_size) / 12
    total_costs = monthly_api_cost + training_amortized
    
    break_even_hours = total_costs / hourly_rate
    
    # Per person per day
    per_person_per_day = break_even_hours / team_size / working_days
    
    return {
        "total_monthly_hours": break_even_hours,
        "per_person_per_day_minutes": per_person_per_day * 60
    }

# Příklad
be = break_even_hours(
    monthly_api_cost=500,
    hourly_rate=75,
    team_size=10
)

print(f"Break-even: {be['per_person_per_day_minutes']:.0f} minutes per person per day")
# Output: ~10 minutes per person per day

Většina týmů dosahuje break-even během prvních dnů používání.