Skip to content

Commit b81e2ec

Browse files
Update spilled arrays blog date
1 parent 0d98e91 commit b81e2ec

File tree

1 file changed

+5
-5
lines changed
  • content/posts/calculating-spilled-arrays

1 file changed

+5
-5
lines changed

Diff for: content/posts/calculating-spilled-arrays/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Calculating spilled arrays in a spreadsheet"
33
summary: " "
44
author: "Prabhanshu Gupta"
5-
lastmod: 2024-01-26
5+
lastmod: 2024-02-01
66
---
77

88
A spreadsheet formula can evaluate to a single value or an array of values. When it evaluates to an array, the result is "spilled" into neighbouring cells underneath. Here's an example
@@ -133,7 +133,7 @@ When a spiller evaluates to an array of values
133133

134134
Whenever a cell is evaluated, we evaluate the `interested-spillers` in addition to other formula dependents. This can be done by adding `interested-spillers` to the depgraph as a reval dependent.
135135

136-
Note that while spilling, if a cell is already spilled into we return a `Spill Error`. This ensures that the first edited formula stays spilled and future spillers don't.
136+
Note that while spilling, if a cell is already spilled into we return a `Spill Error`. This ensures that the oldest formula stays spilled and future spillers don't.
137137

138138
## Detecting circular dependencies
139139

@@ -155,9 +155,9 @@ Let's look at how a cycle can manifest with spilled arrays.
155155

156156
1. `D5` refers to `B1:D3` and spills into `E6`.
157157
2. `E6` gets the value `105` since `C2` is `5`.
158-
3. A formula is entered into `C2` that refers to `E6` (here is the loop).
158+
3. A formula is entered into `C2` that refers to `E6` (here is the cycle).
159159

160-
Upon evaluating `C2` we'll go into a cycle. Here's the depgraph.
160+
Upon evaluating `C2` we'll enter a loop. Here's the depgraph.
161161
<p><img src="spill-depgraph.png" class="w-60 mw-95"></p>
162162

163163
Hang on a second. If you follow the arrows though, there's clearly no cycle in the depgraph. How come?
@@ -182,7 +182,7 @@ A working implementation of all this can be found [here](https://github.com/nile
182182
[^excel-dynamic-arrays]: [Dynamic array formulas and spilled array behavior](https://support.microsoft.com/en-us/office/dynamic-array-formulas-and-spilled-array-behavior-205c6b06-03ba-4151-89a1-87a7eb36e531) – support.microsoft.com
183183
[^google-array-formulas]: In Google Sheets, you can wrap a formula in an [`ARRAYFORMULA`](https://support.google.com/docs/answer/3093275?hl=en) to achieve the same result. Sheets has had the feature for very long (at least since 2009) while Excel introduced this in 2018.
184184
[^sestoft-calls-it-a-support-graph]: It's called a `Support graph` in [Spreadsheet Implementation Technology](https://direct.mit.edu/books/book/3071/Spreadsheet-Implementation-TechnologyBasics-and) by Peter Sestoft.
185-
[^phases]: We can mark two "phases" in a spreadsheet's evaluation. A first pass, when we start with a sheet full of formula strings and no other information. All the cells in a sheet need to be evaluated in _some_ order (row-major, let's say). The first pass sets up the stage for any incremental re-evaluations. <br><br> Once a first pass is done, each cell update causes an incremental re-evaluation. We tackle incremental re-evaluations first. The first pass can then be expressed as incremental evaluations over each cell starting with a blank sheet.
185+
[^phases]: We can mark two "phases" in a spreadsheet's evaluation. A first pass, when we start with a sheet full of formula strings and no other information. All the cells in a sheet need to be evaluated in _some_ order (row-major, let's say). The first pass sets up the stage for any incremental re-evaluations. <br><br> Once a first pass is done, each cell update causes an incremental re-evaluation. We tackle incremental re-evaluations here. The first pass can then be expressed as incremental evaluations over each cell starting with a blank sheet.
186186
[^lord-io]: [How to recalculate a spreadsheet](https://lord.io/spreadsheets/), lord.io
187187
[^sestoft]: Once a first pass is done, each cell update causes an incremental re-evaluation. We tackle incremental re-evaluations first. The first pass can then be expressed as incremental evaluations over each cell starting with a blank sheet.
188188

0 commit comments

Comments
 (0)