How to Fix Google Sheets ‘Circular Dependency Detected’ Error

Working on complex spreadsheets in Google Sheets only to encounter cells tagged with a red corner error reading “Circular dependency detected” (#REF!) halts automated formula calculations. A circular dependency occurs when a formula directly or indirectly refers to its own cell coordinate. For instance, entering =A1+10 inside cell A1 forces Google Sheets into an infinite recursive loop, as calculating the cell value requires the cell value itself. Resolving this condition involves identifying the dependent reference chain, refactoring formula ranges, or enabling iterative calculation settings for intentional financial models.

Identify and Trace the Circular Reference Chain

In extensive worksheets spanning hundreds of rows and cross-sheet lookups, locating the exact cell causing the recursion can prove challenging.

  1. Hover your mouse cursor over the red triangular error badge in the affected cell to read the tooltip details.
  2. Inspect the formula bar at the top of the sheet. Look for direct self-references (e.g. including cell C10 inside a SUM(C1:C10) range).
  3. To trace indirect circular loops across multiple helper columns:
    • Check whether Cell A refers to Cell B, Cell B refers to Cell C, and Cell C refers back to Cell A.
    • Temporarily replace references in suspected intermediary cells with static numbers to determine which branch breaks the recursive cycle.
  4. Correct the range boundaries. For example, if you are summing column C above the total row at row 10, change the range from =SUM(C1:C10) to =SUM(C1:C9).

Enable Iterative Calculation for Legitimate Recursive Models

Certain engineering, scientific, and actuarial models intentionally rely on circular references to converge on optimal solutions through successive iterations.

  1. Click File in the top menu bar of Google Sheets.
  2. Select Settings (or Spreadsheet settings).
  3. Switch to the Calculation tab in the dialogue box.
  4. Under the Iterative calculation section, switch the toggle from Off to On.
  5. Specify the Max number of iterations (the default is 50; set higher if model convergence requires additional steps).
  6. Set the Threshold (e.g. 0.001) to define when calculations stop as values stabilise.
  7. Click Save settings. Google Sheets will execute recursive loops up to your iteration limit without throwing #REF! errors.

Refactor Cumulative Running Balances with ARRAYFORMULA

A frequent beginner mistake is attempting to create dynamic running totals by referencing the previous row within an expanding array formula.

  1. Avoid writing recursive logic like =B2+A3 inside an array formula container.
  2. Instead, utilise modern non-circular accumulators such as SCAN or MAP functions:
    =SCAN(0, A2:A, LAMBDA(prev, current, IF(ISBLANK(current), , prev + current)))
  3. The SCAN function computes rolling cumulative sums in a single vector pass without creating circular cell dependencies.

Break Accidental VLOOKUP and XLOOKUP Circular Loops

When lookup functions query entire column ranges that encompass the formula cell itself, circular warnings trigger automatically.

  • If your formula resides in cell D2, avoid using: =VLOOKUP(A2, C:D, 2, FALSE) because column D encompasses the output cell.
  • Constrain lookup ranges explicitly: =VLOOKUP(A2, C2:D100, 2, FALSE) or move the output formula to a separate analytical column outside the data table.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.