Moving an insurance pricing model out of Excel: a production checklist
Rating engines often start life in Excel. Here is a practical checklist for turning one into a governed, tested pricing service without losing what the actuaries built.
Insurance rating models are some of the most valuable spreadsheets in any company. They hold base rates, factor tables, discounts, loadings and caps, and they're usually maintained by the people who understand them best: pricing actuaries and analysts.
They also tend to end up in production in uncomfortable ways: a workbook on a shared drive, a VBA macro, or a hand-written reimplementation that slowly drifts from the version the pricing team signed off.
This checklist covers what to sort out when you move a rating model into a real service.
1. Decide what the source of truth is
Pick one, and write it down.
- The workbook stays the source of truth. Pricing keeps working in Excel, and the production code is regenerated from it after every approved change. This keeps the people who own the model in charge of it.
- The code becomes the source of truth. Excel is retired after migration. This is cleaner for IT, but every future change needs a developer.
Codcel is built for the first option: the workbook stays the specification, and the generated code is a reproducible build artefact you can diff, review and version.
2. Make the inputs and outputs explicit
A quote has a contract. List the rating inputs (driver age, postcode, vehicle value, years without claims and so on) and the outputs the business consumes (annual premium, monthly premium, and the components you need to explain the price).
In Codcel, you mark these with *I* and *O* annotations, or review and accept auto-detected suggestions. Anything not marked as an output is treated as an internal intermediate.
3. Clean the workbook
Before generating, follow the basics in the Excel guidelines:
- remove external links, comments and embedded objects
- delete hidden sheets you don't need
- use unique sheet names without special characters
- replace volatile values such as
RAND()with fixed values for testing
4. Treat factor tables as data
Rating factors usually live in lookup tables, used through VLOOKUP, XLOOKUP or INDEX/MATCH. Codcel supports these lookups on all of its table types:
- Small tables live in the sheet and can contain formulas.
- Large tables fill a whole sheet (up to 1,048,576 rows).
- Massive tables come from CSV and are stored as Parquet, for very large datasets.
Decide which tables pricing will update often. Keeping them as data, not code, makes a rate change a data release instead of a code release.
5. Prove equivalence before anything else
Codcel generates tests that run each output with the workbook's saved inputs and compare the result with Excel's value. That's a starting point, not a sign-off:
- add test cases for boundary ages, missing optional inputs and capped premiums
- compare a sample of real historical quotes against the model
- read the documented differences from Excel, especially rounding and date handling
6. Choose how the service is deployed
The same model can be generated as:
- a library inside an existing Java, C#, Python or Go policy system
- a REST API (Rust, Java, Kotlin, C# or Go) with an OpenAPI description, called by the quote journey
- an MCP server, so an AI assistant can call the rating engine as a tool
All of it is ordinary source code in your repository. There's no proprietary runtime to license or keep alive.
7. Put the model under change control
Commit the workbook and the generated code together. When pricing changes a factor, the pull request shows both the spreadsheet change and the resulting code diff, and the generated tests run in CI like any other tests.
Want to see this on your own rating model? Book a 30-minute demo and bring the workbook, or read more about insurance pricing with Codcel.
Keep reading
How to convert an Excel spreadsheet to Python without rewriting your formulas
A step-by-step guide to turning an Excel model into a tested Python package: tag inputs and outputs, generate the code, and prove it matches the workbook.
One billion rows from an Excel model: the 1BRC with generated Rust
We pointed Codcel at the One Billion Row Challenge: a 12 GB CSV, an ordinary Excel workbook, and a generated Rust REST server. Here's how it works and what it measured.
VLOOKUP, XLOOKUP and INDEX/MATCH: what happens to lookups when Excel becomes code
Lookups are the backbone of most business spreadsheets. Here's how Codcel carries them into generated code, from small in-sheet tables to billions of rows.