Contact-center formulas you can test
Erlang C staffing, service level, occupancy, AHT, first contact resolution, CSAT, NPS and cost per ticket as small, pure TypeScript functions. Zero dependencies, fully typed, and covered by unit tests. Erlang C is checked against the textbook closed form and published tables.
npm install github:andrewhall07/contact-center-math
import { solveStaffing } from 'contact-center-math/erlang-c'
solveStaffing({ contacts: 100, intervalSec: 1800, ahtSec: 180, targetSL: 0.8, targetSec: 20 })
// → { agents: 14, serviceLevel: 0.888, asaSec: 7.84, occupancy: 0.714, … }
Modules
Erlang CErlang C staffing in TypeScript: traffic intensity, probability of waiting, service level, average speed of answer and shrinkage, with a worked example and a live demo.
OccupancyAgent occupancy from actual handle and available time, how it differs from utilization, the 85% ceiling, and occupancy at a fixed headcount via Erlang C.
AHTAverage handle time from talk, hold and after-contact work, plus a cohort view that separates AI-only, handoff and human contacts so AHT stays honest after an AI rollout.
FCRFirst contact resolution as gross and net rates with a 95% margin of error, and a strict split that never counts an AI-to-human handoff as resolved on first contact.
CSATCustomer satisfaction (CSAT) as a top-box share on 1–3, 1–5, 1–7 and 1–10 scales, with DSAT, average score, 95% margin of error and the sample size needed for ±5 points.
NPSNet Promoter Score from 0–10 ratings with the correct margin of error for a difference of two proportions, and the sample size needed to detect a 5-point change.
Cost per ticketFully loaded support cost per ticket, per contact and per verified resolution, plus how to compare AI cost per resolution against a human cost per ticket without mixing denominators.
Why another Erlang C implementation?
- Numerically stable. Erlang B recursion instead of factorials, so 5,000-agent centres work without overflow.
- Models AI in the queue. AI containment in staffing, AI-vs-human AHT cohorts, and FCR that never counts a handoff as a first-contact resolution.
- Reports uncertainty. CSAT, NPS and FCR return a 95% margin of error and the sample size needed for ±5 points.
- Honest edge cases. Unstable queues, impossible targets and invalid inputs return explicit flags or errors, never
NaN.
Prefer a calculator?
If you'd rather not write code, the Resolution-to-Cost Index calculators run the same formulas in the browser, with staffing tables and charts.