I needed the ability to safely execute formulas in my .NET app. My solution was to write a parser and interpreter. Here it is:
https://github.com/Rajeev-K/formula-parser
You can do this already with DataTables, which is basically an in-memory Excel spreadsheet. Bonus is that it also supports Excel functions, and it’s completely safe/sandboxed code.