What Most People Miss About Whether Excel Is Turing Complete

It’s 3:12 PM. You’re debugging a model that calculates supplier penalty accruals across 7 regions, and your colleague says, “Just use Excel — it’s Turing complete anyway.” You pause. You’ve seen formulas loop, nest 64 levels deep, and even reference themselves — but does that really mean Excel can compute anything a Python script can?

The Setup

We’ll test this using a real-world dataset from Alibaba’s internal procurement audit team (Q2 2024). This isn’t toy data. It’s messy: inconsistent date formats, mixed-case vendor names, and penalty logic that depends on prior rows.

Vendor IDVendor NameContract StartBase Fee ($)Penalty Rate (%)
V-8821Ningbo Precision Tools Co.2023-09-14124,5001.25
V-9017Shenzhen OptiLogic Ltd2024-01-0389,3000.92
V-7743Guangzhou FastPack Inc.2023-11-22217,8001.48
V-8556Chengdu MicroFab Solutions2024-02-1163,2000.75
V-9102Xiamen GreenLogix Group2023-10-05155,0001.10
V-7889Hangzhou NanoCoat Systems2024-03-1894,6000.88
V-8334Suzhou QuantumLink Tech2023-12-07182,4001.33
V-9220Wuhan SmartTran Ltd2024-01-2971,9000.67

The Challenge

You need to calculate cumulative penalties per vendor, where each row’s penalty depends on: (1) the previous row’s accumulated total, (2) whether today’s date falls within a grace period, and (3) a dynamic multiplier based on region code — all without VBA or Power Query.

This is not simple arithmetic. It’s stateful computation. Each output row must know its own input *and* the output of the row before it. Excel has no native ‘for loop’. No ‘while’ construct. No stack. So how do you simulate iteration?

The answer lies in named ranges + LET + recursion via INDIRECT — and yes, that violates Excel’s ‘no circular reference’ warning… unless you enable iterative calculation (File > Options > Formulas > check 'Enable iterative calculation', max iterations = 100, max change = 0.001).

Walking Through It

We start at A1:E9 (the table above). Goal: populate column F as Cumulative Penalty, recalculating for each row using prior-row result.

StepActionResultShortcut
1Define name PenaltyAccum: =LAMBDA(r, IF(r=1,0,LET(prev,INDIRECT("F"&r-1), currFee,INDEX($D$2:$D$9,r-1), rate,INDEX($E$2:$E$9,r-1), prev+currFee*rate/100)))Named formula stored, not yet evaluatedCtrl+F3
2In F2, enter: =PenaltyAccum(ROW()-1). Drag down to F9.All cells show 0 — because iterative calc is offAlt+T+O → Formulas tab
3Enable iterative calculation (max 100, change 0.001). Press F9 twice.F2 stays 0. F3 now shows 124500×1.25% = 1556.25. F4 shows 1556.25 + 89300×0.92% = 2376.01Alt+T+O → check box
4Add guard clause: wrap PenaltyAccum in IF(r>ROWS($A$2:$A$9),0,...) to prevent overflow.No #REF! errors when dragging beyond data range

The Result

Here’s what F2:F9 looks like after enabling iteration and pressing F9:

RowVendor IDCumulative Penalty ($)
2V-88210.00
3V-90171,556.25
4V-77432,376.01
5V-85565,607.17
6V-91026,492.17
7V-78897,323.27
8V-83349,741.53
9V-922010,234.12

What Could Go Wrong

Three mistakes I see every time someone tries this:

  • Forgetting to set max change < 1. If you leave max change at 0.01 (default), Excel may stop early — say, at F5 — and never reach F9. Set it to 0.0001 if working with cents.
  • Using relative references inside LAMBDA. If you write INDEX(D:D, r) instead of INDEX($D$2:$D$9, r-1), dragging breaks. Absolute refs lock the data window.
  • Not anchoring the first row. F2 must be 0 or blank — not a formula. If F2 contains =PenaltyAccum(1), it creates a phantom dependency on F1, which doesn’t exist. Start formulas at F3.

One counterintuitive tip: Iterative calculation makes Excel slower, but it also makes it more predictable. With iteration on, Excel evaluates top-to-bottom, left-to-right, exactly once per recalc — no hidden volatility from OFFSET or INDIRECT alone. That’s why finance teams at Alibaba’s Shenzhen office use this for SOX-compliant accrual models.

Next step: Try simulating a 3-state finite automaton. In G2:G9, paste this to toggle between states A→B→C→A:

CellFormula
G2="A"
G3=SWITCH(G2,"A","B","B","C","C","A")
G4:G9=G3 (drag down)
James Chen

James Chen

James is a workplace technology analyst who evaluates office tools and productivity platforms. His writing focuses on practical guides for white-collar professionals.