Is it possible to parse .xlsx for functions that can be used in Observable?

My users have 1,000s of functions in Excel, not just data. Is it possible to access them from Observable? Maybe the Sheetjs library can do this? If so, can someone point me at a tutorial or other reference for the steps to get this to work?

Both sheetjs and exceljs can be used with observable. FileAttachments.xlsx uses exceljs under the hood, since it’s lighter, and also doesn’t have the date issue that we’ve seen with sheetjs.

Here’s how FileAttachments.xlsx reads a cell’s content: stdlib/xlsx.mjs at main · observablehq/stdlib · GitHub
as you can see, when a cell is a formula or sharedFormula, we return its value (or error value), and dump the formula. You’d have to do the opposite.

More details are given here:

The formula (or shared formula) will be returned as strings (written in Excel language). I don’t know if there is a JS interpreter for them.

Let me know if you have further questions. I’d love to see a working example.