Build a sales commission calculator
Inputs
commission_plan(required): The plan as written - quota and period, base rate, tiers or accelerators, caps, thresholds, draws, splits, clawback terms, and when commission is earned (booking, invoice or payment). Paste the actual wording if you can.app(optional; one of: excel, google-sheets; default: excel): Spreadsheet application to build it in.
Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.
- Rewrite the plan as numbered rules: the measure (bookings, revenue, gross margin), the period and any true-up, quota, base rate, tiers with their lower and upper bounds, whether tiers are marginal or retroactive, accelerators and decelerators, thresholds below which nothing is paid, caps (on attainment or on payout), splits, draws (recoverable or not), clawbacks (trigger, look-back window, amount), and when commission is earned.
- List every ambiguity, with the interpretation you will build and its effect in one example. Do not resolve material ambiguities silently: the plan owner decides. Typical ones: marginal versus retroactive tiers, whether a boundary value belongs to the lower or upper tier, whether a clawback uses the rate paid at the time or the current rate.
- Workbook layout:
- Plan sheet: an input table of tiers (lower bound, upper bound, rate) plus named cells for quota, cap, threshold, draw and clawback window. No rate appears in any formula.
- Deals sheet: one row per deal with rep, close date, amount, split percentage, status (booked, cancelled), cancellation date.
- Calculation sheet: one row per rep per period, with credited amount, attainment, payout before cap, payout after cap, clawbacks, draw recovery, amount due.
- Formulas:
- Marginal tiers: the sum over tiers of the amount falling inside each tier times its rate, with
SUMPRODUCTover the tier table (amount above each lower bound, limited to the tier width) or aLETthat names each piece. - Retroactive tiers: the rate found with
XLOOKUPin next-smaller match mode (orVLOOKUPapproximate match on an ascending table) times the whole credited amount. - Caps, thresholds and clawbacks as separate visible columns, not folded into one formula.
- Marginal tiers: the sum over tiers of the amount falling inside each tier times its rate, with
- Write test cases computed by hand from the plan text, independent of the formulas: zero sales, just below the threshold, exactly at each tier boundary, just above it, a large amount that hits the cap, a split deal, and a deal cancelled inside and just outside the clawback window. The person can then type each case in and compare.
Ambiguities
Table: Question | Interpretation used | Effect on one example | Who should decide.
Workbook layout
Each sheet, its columns and the named cells.
Formulas
Table: Column | Formula for the first row | What it does. Formulas ready to paste.
Test cases
Table: Case | Inputs | Hand calculation | Expected payout.
Audit notes
Three to five bullets: locking the Plan sheet, versioning the plan per period, reconciling payouts with payroll, and checking the test cases after any change.