From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Determining calculation order

Determining calculation order

- [Instructor] When we write Python code in our Excel cells, we want to be careful about where we place our code and, subsequently, the cells that reference other pieces of Python code. These Python code cells need to execute in an order where they go across and down from the previous references in a Z shape. Excel also reads from the first sheets to the last in that order, so we want to think about this order strategically as we build out our models by optimally putting the calculations in the pages after the data, especially for Python code. In the order tab of our Excel file let's see how this works for better context. Let's set the blue cell in the middle of the grid for the Excel cell calculation order to three. We'll then display the calculation that we want to put into the eight cells surrounding it. We're going to take the cell C five and add two to it. Here's the formula we're going to put in these gray cells surrounding the blue one in the calculation table above it. We'll…

Contents