Skip to content

Defined names: relative references follow the cell that uses the name - #398

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
nihilist-narwhal:fix-relative-names
Oct 11, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
nihilist-narwhal:fix-relative-names

Conversation

@nihilist-narwhal

Copy link
Copy Markdown
Contributor

A name without $ was evaluated as if absolute: LeftCell defined from B2 as =Sheet1!A2 gave A2 wherever it was used. Excel stores such references relative to A1, as Sheet1!XFD1 (wrapping at the sheet's edges), and moves them by the using cell's offset; in Excel for Mac, =LeftCell in C10 gives B10, and on Sheet2 it still reads Sheet1. formulas.defineName now takes relative references as seen from the active cell, as the Name Manager does, and stores them relative to A1.

#208 resets its evaluator shift inside names, so whichever lands second needs to combine the two.

A name whose references have no $ was evaluated as if they were
absolute. In Excel such references are relative: defined from B2,
=Sheet1!A2 means "the cell to the left", and the file stores it
relative to A1 (Sheet1!XFD1, wrapping around the sheet's edge).

Name formulas with relative references are now moved by the using
cell's offset from A1, wrapping at the edges, and formulas.defineName
takes relative references as relative to the active cell, as Excel's
Name Manager does, and stores them relative to A1.
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit d821aa1 into storytold:main Oct 11, 2026
@echelon

echelon commented Oct 11, 2026

Copy link
Copy Markdown
Member

Merged — thank you for the contribution!

If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants