Community生产力与协作github.com

andreworia/单位经济学

基于月度留存网格构建包含单位经济学、留存队列分析的 .xlsx 工作簿,自动计算 CAC、LTV、LTV/CAC 和 CAC 回收期,并附带检查选项卡。适用于需要单位经济学、LTV/CAC 分析、回收期模型或留存队列构建的场景。

单位经济学 是什么?

该技能(Skill)旨在帮助 SaaS 及订阅制企业的分析师、产品经理和财务人员快速构建一个包含单位经济学和队列留存分析的可下载 Excel 工作簿。用户只需提供销售与市场支出、新增客户数、ARPU、毛利率、月度流失率和折现率等关键假设,技能便会自动生成一个包含封面、假设、留存队列、单位经济学、LTV/CAC 和检查共六个选项卡的 .xlsx 文件。工作簿中的所有公式均实时计算,支持基础/乐观/悲观三种情景模拟,并通过独立检查选项卡确保数据一致性和逻辑正确性(如留存率单调递减、LTV/CAC 计算一致)。该模型不依赖任何 Excel 插件或 Microsoft 365 连接,完全基于 Python 的 openpyxl 库构建,并在生成后通过 LibreOffice 无头计算验证公式无误,适合用于董事会汇报、尽职调查或内部决策分析。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/andreworia/claude-excel-skills/tree/main/skills/unit-economics

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

单位经济学(LTV/CAC 与队列留存分析)

使用时机

当你需要判断客户的价值是否高于获取成本时使用:包括 CAC、毛利润贡献、留存率、LTV、LTV/CAC 比率以及 CAC 回收期(月数)。适用于 SaaS 和订阅制业务,以及需要以留存队列网格支撑核心指标的董事会汇报和尽职调查。该技能通过 openpyxl 在 Claude 应用中构建一个可下载的 .xlsx 文件;不依赖任何 Excel 插件或 Microsoft 365 连接。

构建内容

一个包含六个选项卡的工作簿:

  • 封面:标题、颜色图例、情景选择器、核心 LTV/CAC 和回收期。
  • 假设:蓝色输入项(销售与市场支出、新增客户数、ARPU、毛利率%、流失率、折现率、情景乘数)。
  • 队列:留存网格,行代表队列,列代表月份,包含保留百分比和每个队列的收入。
  • 单位经济学:CAC、ARPU、每个客户的贡献、回收期。
  • LTV-CAC:通过简单公式和折现队列贡献计算的 LTV,以及 LTV/CAC 比率。
  • 检查:一致性、留存单调性和回收期合理性标志。

构建工作流

  1. 创建工作簿及上述顺序的六个选项卡。
  2. 在假设选项卡中,以蓝色列出所有输入项及单位;添加一个情景单元格(1=基础,2=乐观,3=悲观)并命名为 scn。
  3. 在单位经济学选项卡中,根据支出和客户输入构建 CAC 和每个客户的贡献。
  4. 构建队列网格:第 0 个月基数为 100%(或起始客户数),之后各月按留存率衰减。
  5. 在留存网格下方为每个队列添加收入和贡献行。
  6. 在 LTV-CAC 选项卡中通过两种方式计算 LTV:封闭形式和折现队列求和;计算 LTV/CAC 比率和回收期。
  7. 构建检查选项卡,包含一致性、单调性和回收期测试。
  8. 通过 LibreOffice 无头计算重新计算工作簿,确保所有公式生效。
  9. 验证公式错误(#REF!、#DIV/0!、#VALUE!、#NAME?)为零;循环修复并重新计算,然后交付。

每个选项卡详细规范

封面

  • 标题单元格、模型用途说明和构建日期。
  • 颜色图例块:蓝色样本标注“输入”,黑色标注“公式”,绿色标注“跨表链接”。
  • 情景回显:=CHOOSE(scn,"基础","乐观","悲观") 从假设选项卡提取当前情景。
  • 核心输出以绿色跨表链接显示:LTV/CAC =LTV-CAC!<比率单元格>、CAC 回收期(月)和折现后 LTV。
  • 一行说明文字,提示工作簿在 Excel 中实时重算,且构建时已验证无错误。

假设

  • B2 情景选择器(蓝色,值 1/2/3),命名为 scn。
  • B5 每期销售与市场支出;B6 新增客户数。
  • B7 每月的 ARPU;B8 毛利率%。
  • B9 月度流失率%(因此月度留存率 =1-B9);B10 每月折现率。
  • 流失率和 ARPU 的情景乘数(基础/乐观/悲观):B12 中的有效流失率 =CHOOSE(scn,...),B13 中的有效 ARPU =CHOOSE(scn,...)。

单位经济学

  • B3 CAC =假设!B5/假设!B6。
  • B4 有效 ARPU =假设!B7*假设!B13。
  • B5 每客户每月毛利润 =B4*假设!B8。
  • B6 月度留存率 =1-假设!B9*假设!B12。
  • B7 CAC 回收期(月)=CAC/每客户每月毛利润 =B3/B5。如果偏好考虑队列的回收期,可计算每个队列每月的累计毛利润直到超过 CAC,并报告该月索引。
  • B8 客户平均生命周期(月)=1/(假设!B9*假设!B12)。

队列

  • 第 3 行月份标题 0,1,2,...,N 分布在列上。
  • A 列队列标签(队列 1,队列 2,...)。
  • 保留百分比:第 0 个月单元格 = 1(100%);之后每月 =前一个月单元格*'单位经济学'!$B$6(应用月度留存率)。整行使用一个一致的公式。
  • 每队列活跃客户数:=保留百分比 * 假设!$B$6。
  • 每队列每月收入:=活跃客户数 * '单位经济学'!$B$4。
  • 每队列每月贡献:=收入 * 假设!$B$8。

LTV-CAC

  • B3 LTV 封闭形式 ='单位经济学'!B4*假设!B8/('单位经济学'!B6 生命周期流失率) 即 =ARPU*毛利率%/流失率;单元格中为 ='单位经济学'!B4*假设!B8/(假设!B9*假设!B12)。
  • B4 LTV 折现队列:对每个客户贡献按月份折现求和,=SUMPRODUCT(每个客户贡献行, 1/(1+假设!B10)^月份索引),使用第 0 个月队列行除以起始客户数以得到每个客户的值。
  • B5 LTV/CAC =B4/'单位经济学'!B3(优先使用折现后 LTV)。
  • B6 回收期回显 ='单位经济学'!B7。

检查

  • 一致性:=IF(ABS(LTV_封闭形式-LTV_折现)/LTV_折现<=假设!tol,"通过","失败")。
  • 每个队列内留存的单调性:=IF(SUMPRODUCT(--(本月单元格>上月单元格))=0,"通过","失败"),确保没有月份超过前一个月。
  • 回收期为正且在规定的上限内(蓝色输入项)。
  • LTV/CAC 使用与队列网格相同的 ARPU、毛利率和流失率计算。

公式与格式约定

  • 蓝色字体用于输入项(仅假设选项卡)。黑色用于表内公式。绿色用于跨表链接。
  • 公式中不硬编码数字;常量放在假设选项卡中。使用绝对引用指向留存率和 ARPU 驱动因素,以便队列行可以顺畅填充。
  • 每个队列行使用一个一致的公式,以便复制到不同月份而不需修改。
  • 留存率和毛利率以百分比表示;CAC、LTV、ARPU 以货币单位表示;回收期和生命周期以一位小数表示的月数。
  • 为检查选项卡和 LTV 公式的可读性,命名 scn、tol、CAC 和留存率单元格。

检查项

  • LTV/CAC 计算一致(封闭形式和折现形式在容差范围内)。
  • CAC 回收期以月报告且为正。
  • 每个队列内留存率单调非增(没有月份超过前一个月)。
  • 毛利率和留存率在 0 到 1 之间;CAC 和 LTV 非负。

重新计算与验证

写入后,通过 LibreOffice 无头计算重新计算,使 openpyxl 公式文本变为计算值。检查每个工作表是否存在 #REF!、#DIV/0!、#VALUE!、#NAME?。注意 LTV 和回收期需要除以流失率,因此需防止流失率为 0 导致的 #DIV/0! 错误。修复任何有问题的公式或缺失的命名范围,然后循环重新计算。仅当检查选项卡显示所有项为“通过”且没有错误字符串时方可交付。

需要收集的输入项

  • 同一时期的销售与市场支出及新增客户数(用于 CAC)。
  • 每月的 ARPU 和毛利率%。
  • 月度流失率(或留存率)和折现率。
  • 要建模的队列数和月份数。
  • 流失率和 ARPU 的情景乘数(基础/乐观/悲观)及容差范围。

示例

假设场景:销售与市场支出 200,000,新增客户 400,因此 CAC 为 500。每月 ARPU 为 50,80% 毛利率给出每客户每月毛利润 40,回收期 12.5 个月。4% 月度流失率意味着平均生命周期 25 个月;封闭形式 LTV 约为 1,000,折现队列 LTV 略低;LTV/CAC 接近 2.0 倍。队列网格中每个队列依次衰减为 100%、96%、92.2%、...,各月贡献之和等于折现后 LTV。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

andreworia/assumption-registry-builder

Creates a structured assumption register for any Excel model with columns for name, category, base value, source, Bull/Bear values, sensitivity rank, and owner, plus a formula for computing sensitivity rank from Data Table outputs.

andreworia/data-cleaning-for-excel

Turns pasted or exported data with mixed formats, blank rows, or duplicates into a clean, consistently formatted range ready for analysis. Use it right after pasting raw data into a worksheet.

andreworia/formula-audit-checker

Provides a systematic audit checklist for Excel model formula logic, hardcoded values, circular references, and error handling, with step-by-step instructions for using Excel's native auditing tools.

andreworia/inputs-calcs-outputs-design

Enforces the three-tab separation principle for any Excel model, producing a full design for a dedicated Inputs tab, one or more Calculations tabs, and a clean Outputs tab with a conventions checklist.

andreworia/model-architecture-template

Defines the master tab structure, naming conventions, color codes, number formats, and print area setup for any new strategy or finance Excel model, serving as the structural template before any content is added.

andreworia/output-summary-tab

Designs the executive summary tab of an Excel model with KPI tiles, a narrative block, a sensitivity summary, and an assumption log, formatted for print or screenshot use in a board pack.

andreworia/pivot-table-builder

Specifies and builds a pivot table from a flat data range, choosing rows, columns, values, and filters. Use it when you have raw tabular data and need a summary view without building it cell by cell.

andreworia/revenue-build

Builds a driver-based revenue forecast .xlsx with live formulas across separate drivers, build, and output tabs plus checks, rolling a customer or units schedule (beginning, adds, churn, ending) into revenue with Base/Bull/Bear scenario toggles. Use when someone needs a bottom-up revenue model, an ARR build, or a driver-based forecast for planning or a board deck. Do not trigger for editing an existing workbook through the Claude for Excel add-in.

andreworia/scenario-manager

Builds a Base/Bull/Bear scenario switching layer for a model in a .xlsx with a live selector, CHOOSE or INDEX assumption links, a side-by-side output comparison, and a recalc check, then delivers the workbook. Use when someone wants an auditable scenario toggle instead of Excel's hidden Scenario Manager. Do not trigger for editing an existing workbook through the Claude for Excel add-in.

andreworia/sensitivity-tables

Builds one- and two-variable sensitivity (Data Table) analysis on a model output in a .xlsx with live formulas and a recalc check, then delivers the workbook. Use when someone wants to see how an output (NPV, IRR, EPS, margin) moves as one or two inputs change. Do not trigger for editing an existing workbook through the Claude for Excel add-in.

andreworia/sensitivity-tornado

Ranks variable sensitivities to a key output and builds a tornado chart by swinging each input over a defined range, computing output impact, and producing a horizontal bar chart data structure.

相关技能