Skip to content

Instantly share code, notes, and snippets.

@thijsc
Created April 17, 2018 18:39
Show Gist options
  • Save thijsc/477c76d1fea80a888a439c4f1f295284 to your computer and use it in GitHub Desktop.
Save thijsc/477c76d1fea80a888a439c4f1f295284 to your computer and use it in GitHub Desktop.
Calculating lifetime value example
# Customer Acquisition Cost
@total_cac = 5_000.0
@discounts = 1_000.0
@new_customers = 30
@cac =
(@total_cac + @discounts) / @new_customers
puts "Customer Acquisition Cost: #{@cac}"
# Average Revenue Per Unit
@revenue = 10_000.0
@total_customers = 200
@arpu =
@revenue / @total_customers
puts "Average Revenue Per Unit: #{@arpu}"
# Gross Margin
@revenue = 10_000.0
@direct_costs = 2_000.0
@gross_margin =
(@revenue - @direct_costs) / @revenue
puts "Gross Margin: #{@gross_margin}"
# Churn
@revenue = 10_000.0
@canceled_customer_revenue = 800.0
@churn =
@canceled_customer_revenue / @revenue
puts "Churn: #{@churn}"
# Retention
@base = 1.0
@retention = 0
while @base > 0.1
@base -= @base * @churn
@retention += 1
end
puts "Retention: #{@retention}"
# Lifetime Value
@lifetime_value =
(@arpu * @retention * @gross_margin) - @cac
puts "Lifetime Value: #{@lifetime_value}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment