Curious Minds

Clear answers to science and history questions

Circular Reference: Definition & Examples

· 5 min read · Science

A circular reference occurs when a formula or definition refers back to itself, directly or through a chain of other references, creating an endless loop. In spreadsheets, the most familiar context, this happens when a cell's formula includes its own address—for example, typing =A1+1 into cell A1. The program cannot calculate a value because the result depends on the result. Circular references also appear in programming (a function that calls itself without a stopping condition), in database relationships, and in everyday reasoning (a definition that uses the word being defined). The term is standard technical vocabulary, not slang, and it is used across computing, mathematics, and logic.

Background: Where the Term Comes From

The word "circular" in this context comes from the idea of a circle or loop—a path that returns to its starting point. The concept is old in logic and mathematics: a "circular definition" is one that assumes the very thing it tries to explain. In computing, the term became common with the rise of electronic spreadsheets in the late 1970s and early 1980s, when programs like VisiCalc and later Lotus 1-2-3 introduced automatic recalculation. When a formula depended on its own cell, the software had to detect the loop and warn the user. Microsoft Excel, introduced in 1985, popularized the warning message "Circular Reference" that many people still recognize today.

In programming languages, the same idea appears under different names: infinite recursion, self-reference, or a cyclic dependency. The underlying principle is identical—a definition that cannot be resolved without already knowing the answer.

How Circular References Work

A circular reference arises whenever the evaluation of a value requires that same value to be known first. The simplest case is direct self-reference: cell B2 contains =B2*2. More common—and harder to spot—is indirect circularity, where a chain of cells loops back on itself. For example:

  • Cell A1 contains =B1+1
  • Cell B1 contains =C1+1
  • Cell C1 contains =A1+1

No single cell refers to itself, yet the three form a loop. Spreadsheet software detects this by tracing dependencies. When it finds a cycle, it typically stops calculation and displays a warning, because there is no starting value from which to begin.

In programming, a recursive function without a base case produces the same effect: it calls itself repeatedly until the program runs out of memory or crashes with a stack overflow. A database with two tables that each require a row in the other before insertion is another example of a cyclic dependency.

Common Examples in Spreadsheets

Spreadsheet circular references usually happen by accident, often through a copied formula or a mistyped range. Typical scenarios include:

  • A running total formula placed in the same column it sums, such as =SUM(A1:A10) entered in cell A10.
  • A subtotal cell included in its own sum range after rows are inserted.
  • A formula copied across columns that ends up pointing back to its origin.
  • An interest or growth calculation where the result cell is also an input.

Some spreadsheets allow intentional circular references for iterative calculations—for example, solving equations that require repeated approximation. In Excel, this is enabled through a setting that limits the number of iterations and the acceptable change between them. Without that setting, the program flags the loop as an error.

How to Find and Fix a Circular Reference

Most spreadsheet programs provide tools to locate the offending cell. The general steps are:

  1. Read the warning message—many programs name the cell or sheet where the loop was detected.
  2. Use the error-checking or trace-dependencies feature to follow the chain of formulas.
  3. Check whether the formula should refer to a different cell, or whether a range accidentally includes the formula's own cell.
  4. Correct the reference, or enable iterative calculation if the loop is intentional.
  5. Recalculate and confirm the warning is gone.

A common mistake is to delete the formula entirely, which removes the calculation but not the underlying design problem. A better fix is to restructure the model so that inputs and outputs occupy separate cells.

Circular References Beyond Spreadsheets

The same concept appears in several fields:

  • Programming: a function that calls itself without a terminating condition causes infinite recursion. Compilers and interpreters may detect some cases, but many only fail at runtime.
  • Databases: foreign keys that reference each other can make inserts impossible without temporarily disabling constraints.
  • Logic and language: a circular definition, such as "a widget is a small widget," fails to convey meaning because it assumes what it should explain.
  • Project management: task dependencies that loop—A must finish before B, B before C, and C before A—make a schedule impossible to complete.

In each case, the fix is to break the loop by introducing a starting value, a base case, or an external input that does not depend on the result.

Circular vs. Iterative Calculation

Not every loop is an error. Iterative calculation deliberately repeats a formula until the result stabilizes, which is useful for certain financial and engineering models. The difference is intent and control: an accidental circular reference has no stopping rule, while an iterative calculation has a defined limit and convergence criterion. Spreadsheet settings typically let you cap the number of iterations (often 100 by default in Excel) and set a maximum change threshold. If the values do not converge, the result may be unreliable, so iterative models should be checked against known values.

Frequently Asked Questions

What does "circular reference" mean in Excel?

It means a formula refers to its own cell, directly or through other cells, so Excel cannot calculate a result. Excel displays a warning and may show 0 or the last calculated value until the loop is fixed or iterative calculation is enabled.

Is a circular reference always an error?

No. It is usually a mistake, but some models use intentional circular references with iterative calculation to solve equations that have no direct formula. In that case, the loop is controlled and limited.

How do I remove a circular reference?

Use the spreadsheet's error-checking or trace-dependencies tool to find the cell named in the warning, then adjust the formula or range so it no longer includes itself. Recalculate to confirm the warning is gone.

Can a circular reference crash a program?

In spreadsheets, it usually produces a warning rather than a crash. In programming, unbounded recursion can exhaust memory and terminate the program with a stack overflow error.

What is a circular definition?

A circular definition explains a term using the term itself, such as "happiness is the state of being happy." It is a logical flaw because it assumes the meaning it is supposed to provide.

In this article
  1. Background: Where the Term Comes From
  2. How Circular References Work
  3. Common Examples in Spreadsheets
  4. How to Find and Fix a Circular Reference
  5. Circular References Beyond Spreadsheets
  6. Circular vs. Iterative Calculation
  7. Frequently Asked Questions