# How to Recalculate a Spreadsheet

submited by
Style Pass
2021-05-22 03:00:03

Let's say I'm ordering burritos for my two friends while they quar up in Jersey City, and want to calculate the total price of my order:

It's a little confusing to follow the flow of data in a spreadsheet when it's written like that, so I hope you don't mind this equivalent diagram that represents it as a graph:

We're rounding the cost of an El Farolito super vegi burrito to \$8, so assuming the per-burrito delivery toll remains at just \$2 per burrito, it looks like the total for our two burritos will be \$20.

Oh no, I completely forgot! One of my friends loves to wolf down multiple burritos at a time, so I actually want to place an order for three burritos. If I update Num Burritos, a naïve spreadsheet engine might recompute the entire document, recalculating first the cells with no inputs, and then recalculating any cell whose inputs are ready until we've finished every cell. In this case, we'd first calculate Burrito Price and Num Burritos, then Burrito Price w Ship, and then a new final Total of \$30.

This simple strategy of recalculating the whole document may sound wasteful, but it's actually already better than VisiCalc, the first spreadsheet software ever made, and the first so-called "killer app", responsible for popularizing the Apple II. VisiCalc would repeatedly recalculate cells from left-to-right and top-to-bottom, sweeping over them again and again until none of them changed. Despite this "interesting" algorithm, VisiCalc remained the dominant spreadsheet software for four years. Its reign ended in 1983, when Lotus 1-2-3 swept the market with "natural-order recalculation", as described by Tracy Robnett Licklider in Byte Magazine: