Spreadsheet-defined functions are a way for spreadsheet users to define reusable functions in a way that reuses the existing spreadsheet user-interface and features that they already know.
The idea is that you create a new tab in your spreadsheet, mark some cells as inputs, some cells as outputs, and use existing spreadsheet functionality to derive the output value cells from the inputs. You can use arbitrary formulas, as well as define intermediate values in other cells.
I thought it would be fun to make a demo of sheet functions using IronCalc, which you can try out here:
The demo was written by an LLM, so I have no idea if the code is any good or not, but it seems to work!
I like the name "sheet functions", since it's a bit less verbose.
The spreadsheet contains a bunch of demo sheet functions, all called in the first `Demo` tab, with the rest of the tabs being the function definitions.
Sheet functions use the first column for input, the first cell of the second column for output, and any spreadsheet can be made into a sheet function by selection the `Function sheet` option in the spreadsheet tab drop down, which makes it callable in formulas by its name.
Hopefully it illustrates the power of sheet functions. If you scroll through the tabs all the way to the right, you can see the `Fractal` spreadsheet, which renders the Mandelbrot set using a sheet function.
This is just a demo, the code is probably horrible, and I'm slammed working on other stuff, so I probably won't take it further myself, but I wanted to share. So far, sheet functions haven't made it into any spreadsheet program intended for actual use, and it's something could be an interesting differentiator for IronCalc.
I came up with the idea a while ago[0], but it turns out that they were actually independently invented much earlier. With [this paper](https://www.microsoft.com/en-us/research/wp-content/uploads/...) being the canonical origin of the idea.
The idea is that you create a new tab in your spreadsheet, mark some cells as inputs, some cells as outputs, and use existing spreadsheet functionality to derive the output value cells from the inputs. You can use arbitrary formulas, as well as define intermediate values in other cells.
I thought it would be fun to make a demo of sheet functions using IronCalc, which you can try out here:
https://casey.github.io/IronCalc/
The demo was written by an LLM, so I have no idea if the code is any good or not, but it seems to work!
I like the name "sheet functions", since it's a bit less verbose.
The spreadsheet contains a bunch of demo sheet functions, all called in the first `Demo` tab, with the rest of the tabs being the function definitions.
Sheet functions use the first column for input, the first cell of the second column for output, and any spreadsheet can be made into a sheet function by selection the `Function sheet` option in the spreadsheet tab drop down, which makes it callable in formulas by its name.
Hopefully it illustrates the power of sheet functions. If you scroll through the tabs all the way to the right, you can see the `Fractal` spreadsheet, which renders the Mandelbrot set using a sheet function.
This is just a demo, the code is probably horrible, and I'm slammed working on other stuff, so I probably won't take it further myself, but I wanted to share. So far, sheet functions haven't made it into any spreadsheet program intended for actual use, and it's something could be an interesting differentiator for IronCalc.
[0] And made a video: https://www.youtube.com/watch?v=1WkMpa5zfTA