"Circular dependency detected" in Google Sheets: fix the loop
Circular dependency detected. To resolve with iterative calculation, see File > Settings. Fix the formula that refers to its own cell.
On this page
=D5+C5 became =D4+C5Before Broken tab
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Item | Amount | Balance |
| 2 | 11/1/2026 | Opening balance | 500 | 500 |
| 3 | 11/3/2026 | Dues from Emily | 40 | 540 |
| 4 | 11/4/2026 | Snacks (Jason) | -62.5 | 477.5 |
| 5 | 11/6/2026 | Dues from Kevin | 40 | #REF! |
| 6 | 11/8/2026 | Room rental | -150 | #REF! |
| 7 | 11/10/2026 | Dues from Sarah | 40 | #REF! |
| 8 | 11/12/2026 | Printing (Megan) | -18.75 | #REF! |
What changed
D5now readsD4D5:D8filled in
After Fixed tab
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Item | Amount | Balance |
| 2 | 11/1/2026 | Opening balance | 500 | 500 |
| 3 | 11/3/2026 | Dues from Emily | 40 | 540 |
| 4 | 11/4/2026 | Snacks (Jason) | -62.5 | 477.5 |
| 5 | 11/6/2026 | Dues from Kevin | 40 | 517.5 |
| 6 | 11/8/2026 | Room rental | -150 | 367.5 |
| 7 | 11/10/2026 | Dues from Sarah | 40 | 407.5 |
| 8 | 11/12/2026 | Printing (Megan) | -18.75 | 388.75 |
Google Sheets shows Circular dependency detected. To resolve with iterative calculation, see File > Settings. when a formula needs its own answer before it can produce one. Sheets will not guess, so it stops. The fix is to find the formula that points back at its own cell, directly or through other cells, and aim it somewhere else. In the club ledger below that formula is =D5+C5 in D5, and changing it to =D4+C5 brings every balance back. Iterative calculation, which the message suggests, replaced the error with wrong numbers on this sheet, as shown further down.
An opening 500 plus six amounts in and out should leave the ledger at 388.75. Column D was meant to carry that running balance, and instead D5 through D8 read #REF!. Selecting D5 opens a red box with the message above. Rows 2 through 4 still hold 500, 540 and 477.5, which are right.
Dates sit in column A of the ledger, items in B, money in or out in C, and a balance in D that adds each amount to the balance in the row above. A cell that shows #REF! with a different note, Array result was not expanded, has another cause, covered in the post on that message.
Finding the cell that started it: the first #REF! under a real balance
Selecting D7 on the Broken tab brings up exactly the same text as D5. Its formula, =D6+C7, is fine. D7 needs D6, D6 needs D5, and D5 is the one stuck in the loop, so the note travels down the column. Editing D7 or D8 means editing correct formulas, and the #REF! stays.

In a long ledger that narrows the search to one cell: the topmost #REF! sitting right below a real number. Here that is D5, directly under the 477.5 in D4.
The formula in D5 refers to D5
The formula in D5 is =D5+C5. Every other balance cell points one row up: D3 is =D2+C3, D4 is =D3+C4, D6 is =D5+C6. D5 points at itself. To know D5, Sheets has to know D5 first, and that is the loop the message is talking about.

One row number is off. A 5 where a 4 belongs is a single character, and the cell itself holds only #REF!, so compare the formula in D5 with the one in D4, =D3+C4. The pattern breaks exactly where the red cells start. Had the topmost one looked correct, the loop would run through more than one cell, which is what the More loops tab reproduces.
Fixing the circular reference: point D5 one row up
Change D5 to =D4+C5 and the column fills in. On the Fixed tab, that single edit gives 517.5 in D5, then 367.5, 407.5 and an ending balance of 388.75 in D8. Nothing else on that tab differs from the Broken one, and =SUM(C2:C8) on the More loops tab lands on the same 388.75.
| Input | 7 rows, amounts in C2:C8, opening balance 500 |
|---|---|
| Formula | =D4+C5 in D5, the same pattern in D3:D8 |
| Expected | 500, 540, 477.5, 517.5, 367.5, 407.5, 388.75 |
| Sheets returned | 500, 540, 477.5, 517.5, 367.5, 407.5, 388.75 Matches expected |
| Checked | 2026-11-11, free personal account |
The Try it yourself tab is the Broken tab again, with =D5+C5 still in D5. Select D5, type =D4+C5, and press Enter. D5 through D8 should read 517.5, 367.5, 407.5 and 388.75, the same as the Fixed tab. The More loops tab keeps its two broken examples for tracing practice, and its H2 holds the total C10 should have produced.
Two more loops: a SUM inside its own column, and a chain with no starting number
The More loops tab starts from the fixed ledger and adds two mistakes that produce the same message.
One is a total. B10 says Net change, and C10 holds =SUM(C:C). Column C includes C10, so the sum contains itself. A range that stops above the total, =SUM(C2:C8) in H2, returns 388.75.

The second one has no cell that names itself, which makes it harder to read. F2 is labeled Statement ending and holds =D8, the last balance. Someone then tried to work the opening balance backward from it and put =F2-SUM(C3:C8) in D2. D2 needs F2, F2 needs D8, D8 needs D7, and so on back up to D2. Every balance cell and F2 carry #REF! with the same text, and none of their formulas contains its own address.
To trace a loop like this, follow references from the red cell until you arrive back where you began. While a formula is open for editing, Sheets outlines each cell it refers to in a matching color, so you can see the next cell to visit. For this pair the way out is to type the opening balance from the bank statement into D2 as a plain number, so the chain has a starting point that does not depend on its own end.
Turning on iterative calculation gave 2000 where 517.5 belongs
The second half of the message points at File > Settings. The Calculation tab there has a setting called Iterative calculation, which was Off in this sheet. Google's page on location and calculation settings covers the Calculation mode choices on that same tab. Turned on, it shows two more boxes. The dialog in this sheet filled them with 50 for Max number of iterations and 0.05 for Threshold, and describes them as the most calculation rounds to run and a difference small enough that rounds stop early. Google announced the two limits in a Workspace Updates post when the setting was added.

With the setting on and nothing else touched, the red cells went away. D5 read 2000, D6 1850, D7 1890 and D8 1871.25, against a true ending balance of 388.75. D5 had added Kevin's 40 to itself once per round, and 40 times 50 rounds is 2000. Each round moved the result by 40, never by less than 0.05, so the threshold never stopped it early.

Iterative calculation fits a formula that is meant to depend on its own result and settles toward a stable number, where each round changes less than the one before. Nothing in this ledger is meant to work that way, so this sheet has no reason to turn it on. The dialog is titled Settings for this spreadsheet, so the switch covers every tab in the file. In the shared sheet it is Off again; it was on only long enough to take Figures 5 and 6.
Take-home copy. Four tabs: Broken, Fixed, Try it yourself, More loops. It opens as a copy in your own Drive.