Turn complex Excel models into maintainable code

From Excel to code

From Excel to code
  • November 30, 2026

Every insurer has them: monster spreadsheets. A one-off prototype that quietly became a core process. Few people can operate it. Even fewer fully understand it.

At PwC we built a method to tackle these models. Our AI-powered conversion methodology turns complex workbooks into clean, documented code. Here is what you gain, how it works, and where it leads.

When does an Excel model become too large or too fragile?

If you recognise several of these signs, it’s time to think about model modernisation:

  • Few people really understand the model.
    So when its owner is on leave, all progress stalls.
  • Changing it feels risky.
    Because no one is confident about what a single updated formula will affect elsewhere.
  • It can’t be traced.
    With multiple versions in circulation and no clear view of who changed what.
  • There’s a lot of manual work.
    With data copied and passed into other files.
  • The model is slow or unstable.
    Any scenario analysis is put on hold because it takes too much time.

How it works: four steps 

The aim of the methodology is conversion at scale. Scale alone isn't enough, though. The process and outcomes also have to be reproducible, consistent and controlled. 

That's why the methodology combines human oversight, deterministic automation and AI-driven code conversion. Together, they turn Excel models into clean, documented code in the following four steps: 

  1. Excel model.
    Scope is set by defining all the in-scope tables and variables.  
  2. Structured graph.
    All dependencies between those tables are captured in a graph running from inputs to final output. 
  3. Agentic translation.
    An ensemble of AI agents turns tables into code, debugs errors and checks consistency. Each table is verified against the original Excel. 
  4. Codebase and interface.
    We consolidate the verified code into one model, test it thoroughly, and structure it into a maintainable, fully documented codebase. On top of that we add an interface with clear inputs and guided entry, so running the model requires no technical knowledge.   

This AI-driven conversion methodology enables near-fully automatic conversion, shifting timelines from weeks or months to hours or days. The methodology is model-, company- and industry-agnostic.   

Proven, not theoretical. We have applied the methodology successfully at several large Dutch insurers. One example is a complex cost allocation model at a large life insurer, with roughly 50 worksheets and more than 300 tables. Over 95% of it was converted automatically, and a full translation was ready in two days.

What You Gain When the Logic Moves 

The benefits compound when several models in the same process are converted. Once the logic sits in code, models chain together, run on a schedule and report their own status, without manual hand-offs. Four things change: 

  • Governance and control.
    Every run, input, version and result is logged. Runs become traceable and reproducible, automated testing surfaces errors a large workbook hides, and documented code mitigates key person risk. 
  • Analytics and scalability.
    File size and calculation time no longer decide which analyses are practical. One scenario or a thousand takes similar effort, so sensitivity analysis and stochastic simulation become routine instead of a project. 
  • Integration and automation.
    As code, a model connects to other systems and data platforms, runs on a schedule or on demand, and becomes part of the wider reporting process. It also lets AI agents interact directly with the model: running it, interpreting results and helping develop it further. 
  • Interface and usability.
    A purpose-built interface can sit on top, with input validation and guided entry instead of free-form cells. The model starts to behave like tooling rather than a workbook.  

Together, these changes affect how departments work, not just how models run. Teams share one view of a model run instead of each maintaining their own, and less time spent operating models leaves more time for analysing results. Answers come faster, controls run continuously and analyses that were previously too time-consuming or unpractical become possible.  

Video

From Excel to Code

0:01:53
More tools
  • Closed captions
  • Transcript
  • Full screen
  • Share
  • Closed captions

Playback of this video is not currently available

Transcript

Frequently asked questions

It’s worth converting when only a few people understand how the model works, changing it feels risky, there’s no version control or audit trail, or manual work and slow calculation times are common. If several of these signs sound familiar, the model is likely now too large or too fragile to rely on Excel.

We compare every table against the original workbook, looking at intermediate and final results, using tolerances agreed up front and testing across multiple scenarios. You receive a reconciliation report and, if you’d like, we can run both models in parallel on your real data. The tests stay in the codebase, so any future changes are checked automatically.

This approach is relevant for teams in finance, risk, actuarial, reporting and operations that rely on large, complex Excel models – for example for cost allocation, forecasting, reserving or regular reporting. It also supports second-line functions, because model governance and model risk management are easier when a model is reproducible, tested and documented. The method applies across industries.

Yes. When you convert several models from the same process to code, they can connect and work together. The output of one model becomes the input of the next, without anyone copying or transferring data by hand. The models run on a schedule and report their own status. Your teams can work from one shared view of each calculation instead of keeping separate versions.

Let us handle your monster, so you can focus on the insights.

Get in touch with our team

Want to explore how this method can work for your organisation?

Michel Abbink
Michel Abbink

Partner Risk Modelling Services, PwC Netherlands

Follow us