Repository navigation
Add INDIRECT function (HF-27) - #1843
Draft
Tobiadefami wants to merge 3 commits into
Draft
Tobiadefami wants to merge 3 commits into
Tobiadefami wants to merge 3 commits into
Conversation
INDIRECT resolves its text at evaluation time and records the cell it reads as a runtime dependency in the graph, so it is not volatile. When the target is not current yet in the running pass, the evaluation is deferred: the sort computes the target first, with an explicit stack, and then retries the formula. Covers A1 references to a single cell, on the same or another sheet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INDIRECT now accepts an A1 range, a named expression and R1C1 text (absolute, relative, ranges, sheet-qualified). A range is read lazily: its cells become a runtime dependency of the formula, through the range vertex, the first time the range's values or address are used, so ROWS and COLUMNS read only its size. Changes to named expressions mark INDIRECT formulas for recalculation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…evaluation - Moving a cell that an INDIRECT formula read marks that formula dirty: the address in its text does not move with the cell, so it reads the address again. - A formula whose result is an INDIRECT range records the range as its dependency while it is evaluated, like a literal range; a cell that later reads the stored range no longer reads cells that are not computed yet. - Range and empty cell vertices that lose their last runtime dependent are removed after the evaluation, not during it, while the sort may still hold them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 5368efa | Commit Preview URL Branch Preview URL |
Oct 25 2026, 12:34 AM |
Performance comparison of head (5368efa) vs base (d143456) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The PR adds the INDIRECT function, without making it volatile.
IndirectPlugin.ts: resolves A1 and R1C1 text, cells, ranges and named expressions, on any sheet.DependencyGraph.ts,FormulaVertex.ts,Graph.ts: store each cell or range that INDIRECT read as a runtime dependency of the formula.TopSort.ts,Evaluator.ts,EvaluationPass.ts,EvaluationDeferred.ts: if the target is not computed yet, the formula defers. The sort computes the target first, then retries the formula.SimpleRangeValue.ts: an INDIRECT range records its dependency on first use of its values or address.ROWSandCOLUMNSread only its size.Operations.ts,GraphBuilder.ts: sheet, name and structure changes mark INDIRECT formulas dirty.=INDIRECT("B"&A1)recalculates when A1 or the target changes, and not on unrelated edits.How did you test your changes?
Paired branch in
hyperformula-tests:feature/hf-27-phase2(handsontable/hyperformula-tests#104).npx jestonfunction-indirect.spec.ts,indirect-dependency-graph.spec.tsandgraph.spec.ts: 196 passed.enGB.npm run lint: no errors.Compatibility with Excel and Google Sheets
Not verified yet. Results from Excel Online (en-US) will be added before review.
Public API changes
None, apart from the new INDIRECT function.
Out of scope and follow-ups
"B:B","1:1") and spill references ("D1#").Still to do before review: translations, docs, changelog entry.
Types of changes
Related issues
Checklist
dev-docs/pages this change affects – or none needed it.🤖 Generated with Claude Code