DEV Community

Tidy Cents
Tidy Cents

Posted on

Payback month for a new hire with a linear ramp-up, in integer cents

"Can we afford to hire?" has two parts. Does the business stay above its cash reserve while the person ramps up, and do the extra sales eventually pay the full cost? The second part is a small loop: cumulative effect of the hire, month by month, with sales ramping linearly to full speed.

def hire(salary, oncost_pct, start, extra_sales, ramp, margin_pct, months=12):
    """Integer cents. Returns per-month net effect of the hire, cumulative, payback month."""
    cost = salary * (100 + oncost_pct) // 100
    full_gp = extra_sales * margin_pct // 100
    cum, rows, payback = -start, [], None
    for m in range(1, months + 1):
        gp = full_gp * min(m, ramp) // ramp       # linear ramp, then full speed
        cum += gp - cost
        rows.append(cum)
        if payback is None and cum >= 0:
            payback = m
    ceiling = full_gp * 100 // (100 + oncost_pct)  # largest salary the new sales pay for
    return rows, payback, ceiling

rows, payback, ceiling = hire(400_000, 20, 250_000, 1_400_000, 3, 45)
print([r // 100 for r in rows[:6]], payback, ceiling / 100)
Enter fullscreen mode Exit fullscreen mode

Output:

[-5200, -5800, -4300, -2800, -1300, 200] 6 5250.0
Enter fullscreen mode Exit fullscreen mode

The example: a $4,000 salary plus 20% on-costs ($4,800 a month all-in), $2,500 of start costs, and $14,000 of extra monthly sales at a 45% margin once fully up to speed after three months.

  • Month 1 brings a third of the $6,300 gross profit, so the hire is $5,200 down including start costs.
  • Month 2 is the low point at −$5,800. From month 3 the hire adds $1,500 a month.
  • Month 6 is the payback month (+$200).
  • The salary ceiling is the full-speed gross profit divided by 1.2: $5,250. Above that the hire never pays for itself.

Design notes:

  • Integer division only after multiplying. full_gp * min(m, ramp) // ramp keeps the ramp exact in cents.
  • Report the worst cumulative month, not just payback. The −$5,800 in month 2 is what the bank account has to absorb.
  • Separate affordability from profitability. A hire can pay back in month 6 and still be unaffordable if month 2 crosses your reserve.

Free browser version that also runs it against your cash balance: Hiring Cost Calculator (no sign-up).

Top comments (0)