SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ICircularReference

    A reference cycle — the answer to "why is this cell 0".

    A cell is in a cycle when calculating it opens its own value, directly or through other cells — =A1+1 in A1, =OFFSET(A1,0,0) in A1, =SUMIF(B1,C1,A1) in A1 while B1 matches C1. With iterative calculation off (the default, and Excel's) every cell in a cycle, and every cell downstream of one, evaluates to 0; nothing on the value says why. This does.

    Reached from a cell — ICell.getCircularReference answers it for members and for downstream cells alike — and carried by the ICellRange.Feature.Circular regions, so a range, a sheet or the workbook is asked the way any other error is asked: getCounts(Feature.Circular) for how many, getRegions(Feature.Circular) for which, with this object as each region's payload. There is no list of cycles on the calculation: nobody starts from the cycle; they start from a cell or a range and want to know more.

    Live, not a snapshot: it reads the engine's cycle table on every call and drops members whose formula has since been edited away, so a stale handle answers getMemberCount() === 0. Persists until the last member is edited away.

    interface ICircularReference {
        getDownstreamCount(): number;
        getIterationCount(): number;
        getLastChange(): number;
        getMemberCount(): number;
        getMembers(): readonly CellCoords[];
        getPath(from: CellCoords): readonly CellCoords[];
        getPreviousChange(): number;
        getRepresentative(): CellCoords | null;
        isConverged(): boolean;
        isIterative(): boolean;
        isMember(coords: CellCoords): boolean;
    }
    Index
    • How many cells read the cycle (transitively) and evaluate to 0 because of it.

      Returns number

    • How many sweeps the last evaluation ran — up to the workbook's maxIteration.

      Returns number

    • The largest change any member of THIS cycle made in the last sweep — what stopped the iteration when isConverged, what it never got under when not. 0 with iteration off.

      Returns number

      Convergence is decided across every cycle at once, as Excel decides it, so a cycle can stop on the cap because a different one would not settle. This number is still its own.

    • How many cells are IN the cycle, the representative included.

      Returns number

    • Every cell IN the cycle, in row-major order, scope set to the sheet name. Small — a cycle is the cells that read each other, not everything that reads them (that is getDownstreamCount).

      Returns readonly CellCoords[]

    • The cycle as a walk of reads from from back to itself — each cell reads the next, and the last reads the first. A cycle has no start, so it is told from the cell that asks: with A1 = B1+1 and B1 = A1+1, asked from A1 it is [A1, B1] (A1 → B1 → A1), asked from B1 it is [B1, A1]. A cycle of one is [A1].

      Parameters

      • from: CellCoords

      Returns readonly CellCoords[]

      Exact, not inferred from formula text: it is the order the engine found the cycle in, which is the order the reads happened — a dynamic read (INDIRECT, OFFSET) is a step like any other. Interlocking cycles share members; the walk follows the read that closed the cycle from was found in, so it is ONE loop through that cell, not every member (getMembers is every member).

      Empty when from is not a live member — a downstream cell asks from getRepresentative.

    • The same for the sweep before the last, or NaN when there was only one (and with iteration off).

      Returns number

      Read beside getLastChange it says whether a run that hit the cap was getting anywhere: a change that shrank between the two sweeps settles at a higher maxIteration, one that held or grew does not settle at any.

    • The cell named for the cycle, the way Excel's status bar names one (Worksheet.CircularReference likewise answers a single cell): the first member in row-major order. scope is the sheet name, or null when the member lives in a named formula's body rather than on a sheet.

      Returns CellCoords | null

    • Whether iterative calculation settled it: every member moved by less than the workbook's maxIterateChange in the last sweep. Always false with iteration off.

      Returns boolean

    • Whether iterative calculation was on when the cycle was last evaluated. When false the cycle is unresolved and every member and downstream cell is 0; the iteration answers below are then meaningless (0 sweeps, no change).

      Returns boolean

    • Whether coords is IN the cycle, as opposed to downstream of it. A cell that reads a member's 0 answers false here but still resolves this cycle from ICell.getCircularReference — the tooltip for it says "reads a circular reference at A1", not "is one".

      Parameters

      • coords: CellCoords

      Returns boolean