Welcome, Guest | Browse

Software Factory Archive

← Previous Work All Works Next Work →

The Google Sheets Twin: Formulas

Rating:
General Audiences
Fandom:
StrongDM Software Factory
Characters:
Navan Chauhan Jay Taylor
Tags:
Digital Twin Universe Google Sheets Formulas VLOOKUP Deep Dive
Words:
459
Published:
2025-08-28

The spreadsheet had formulas in every cell of column F. Each formula referenced cells in columns A through E. Some referenced cells in other sheets within the same workbook. Two of them used IMPORTRANGE to pull data from a completely different workbook hosted in the Sheets twin.

Navan changed a single value in cell A1. The twin recalculated 847 cells in under two hundred milliseconds.

"That's the dependency graph," he told Jay. "Every formula has dependencies. When a cell changes, the twin walks the dependency graph and recalculates only the affected cells, in topological order. No cell gets recalculated before its dependencies are resolved."

"What about circular references?"

"The twin detects them and returns a #REF! error, same as real Sheets. Unless you enable iterative calculation, in which case the twin will iterate up to the configured maximum—default is 100 iterations—and converge if possible. If it doesn't converge, it returns the last calculated value and marks the cell as non-convergent."

Jay was studying the VLOOKUP chain. Cell F2 ran a VLOOKUP against a named range on Sheet2. The result of that VLOOKUP was used in another VLOOKUP on Sheet3, which fed into a SUMPRODUCT on Sheet1. "The evaluation chain crosses sheet boundaries?"

"Constantly. Named ranges make it worse because they obscure the actual cell references. The twin resolves named ranges at evaluation time. If someone renames a named range, every formula that references it by name updates automatically. If someone deletes a named range, every formula that referenced it returns #REF!."

"And IMPORTRANGE?"

Navan pulled up the cross-workbook scenario. "IMPORTRANGE is special. In real Sheets, it requires authorization—the first time you use IMPORTRANGE from workbook A to workbook B, Sheets prompts you to allow access. The twin replicates this. There's an authorization step. If the agent hasn't authorized the cross-workbook reference, the formula returns an error. Once authorized, the twin maintains a live link between the workbooks. Change a value in workbook B, and workbook A's IMPORTRANGE result updates."

"Live link meaning..."

"Meaning the twin tracks cross-workbook dependencies. It's not a copy. It's a reference. The dependency graph spans workbook boundaries." Navan's voice carried a note of pride he rarely showed. "I don't think most people realize how complex the Sheets computation model is. It's not just arithmetic in a grid. It's a reactive computation engine with cross-document dependencies, iterative evaluation, and a type system that silently coerces between strings, numbers, dates, and booleans based on context."

"Silent coercion," Jay said. "The best kind."

"The twin handles all of it. =1+"1" returns 2. =A1+B1 where A1 is a date and B1 is a number adds days to the date. =TRUE+1 returns 2 because TRUE coerces to 1. Every coercion rule documented, every edge case captured."

Jay looked at the spreadsheet again. 847 cells, recalculated in under two hundred milliseconds. He changed a value in cell A2. The twin recalculated 312 cells this time—different branch of the dependency graph.

"It's a spreadsheet," Navan said. "It's just a spreadsheet. And it's one of the hardest twins to build."

Kudos: 49

spreadsheet_whisperer 2025-08-30

=TRUE+1 returning 2 is the kind of behavior that makes you question whether spreadsheets are a programming language or a practical joke. Great detail.

formula_forensics 2025-08-31

Cross-workbook dependency tracking through IMPORTRANGE is genuinely impressive for a twin. That's hard enough in the real Sheets.

← Previous Work All Works Next Work →