Lambdas as values in Excel
techcommunity.microsoft.com
techcommunity.microsoft.com
Let's also not forget about the current state of the .NET ecosystem. C#9+ on top of .NET 5+ is an amazing developer experience.
Being able to contribute to the framework via any authenticated GitHub account is nice too. I find myself almost accidentally participating in Microsoft's issue threads simply because it is so easy to do so.
Classic bungling.
=AND(A2>50, A2<80)
=AND(A3>50, A2<80)
...
Appropriately enough, the second line contains a copy-and-paste error!> There is a very extensive research base on the risks of using spreadsheets within business see [Panko, 2000] [Panko & Ordway, 2005] [Powell, Baker & Lawson, 2007]. Much of the research has been coordinated and progressed by EuSpRIG [Chadwick, 2003]. Further significant work improving the end user approach to software has been undertaken by the EUSES consortium [EUSES, 2009].
> The main known risks of spreadsheets include:
> a) Human Error – To err is human, hence the majority (>90%) of spreadsheets contain errors. Because spreadsheets are rarely tested [Panko, 2006] [Pryor, 2004] these errors remain. Recent research has shown that about 50% of spreadsheet models used operationally in large businesses have material defects [Powell, Baker, Lawson, 2007] [Croll, 2008]. Approximately 50% of executives recently surveyed had encountered spreadsheet related problems up to and including staff dismissal [Caulkins, Morrison & Weideman, 2007].
The ability copy-and-paste-absolute and to cut-and-paste-relative should be right there next to cut copy and paste when you right click, and should have been there decades ago.
I wish they made these an add-on.
Until then, I expect to hear my fancy files are "broken."
Even more conservative organisations will often be running Office 365 with a lag, still getting features after ~6 months.
If you need 100% compatibility that will always take a while, and I'm sure some big enterprises are on old style office. But it seems like the vast majority of small/medium business is on the Office 365 juggernaut now.
Also seems difficult to maintain if these are cell-bound, and both the cell edition interface and the Name Manager interface were an incredibly poor edition experience from what I remember, but maybe that improved since?
While these new features seem exciting, I don't expect to use them anytime soon if I'm planning on sharing my work with others because it's not that easy tracking down which features are tied to specific Excel releases.
I do not send spreadsheets anymore and just send a onedrive view only link to whoever needs to see it.
On the chance they need to manipulate I share the edit link (which has version control) and my stress levels are minimal.
See also https://insider.office.com/en-gb/blog/new-lambda-functions-a...
EDIT: Found it: https://docs.microsoft.com/en-us/power-query/. But it doesn’t look particularly F#-like — Power Query seems more focused around, well, querying data.
The main issue I'm facing is how to distribute the library of PQ/M functions I've developed?
Currently I have a central library workbook and then have to copy code from there. Problem is that updates and bugfixes don't flow downstream.
I really hope Microsoft creates a solution for this. Would love to hear about some approaches for handling this in the meantime.
I've been through scenarios where sophisticated calculations were done in excel by domain experts and then it was necessary to translate them into code by developers, so having an excel-as-a-service would be great.
The MS Graph API has a workbook endpoint[1] that lets you do nifty stuff with Excel workbooks hosted in OneDrive or Sharepoint. Pair that with non-persistent sessions[2], and you basically get an Excel workbook as a serverless runtime environment.
If you structure the workbook with this type of use in mind, it works really handily. Create a non-persistent session, updated named items with the input values, run an explicit calculate on the workbook, and grab whatever result you're after (a table, named range, pivottable, chart graphics, etc), close the workbook session (or let it expire).
If you need to keep the data around for historical reasons, you can follow the same process but copy the template workbook and create a persistent session against the copy, so the inputs/outputs are saved.
You can also leverage Power Automate[3] (Microsoft's version of Zapier) to create an actual serverless function for your specific workflow that can accept your inputs, call the appropriate Graph endpoints for those steps, and return the output. Although the licensing gets funky, most people with an Office 365 license have some level of usage included already.
It's definitely not a solution architecture you want to use for anything mission-critical or high-volume, but it's super handy for anything that's going to be Excel based anyway and you'd like to minimize the surface area for human error during the process. Also nifty for situations where a process/scenario/PoC is still being matured and developed in Excel, but you need to use it for production use cases. Create a stable input/output interface with a Power Automate workflow (or other serverless interface) that consumers can work against, then continue your Excel-based process development without disrupting them. At some point when it's stable/mature, port it over to code that maintains that same input/output structure and cut over the downstream consumers to the new endpoint.
[1] https://docs.microsoft.com/en-us/graph/api/resources/excel
[2] https://docs.microsoft.com/en-us/graph/api/workbook-createse...
I can't say for sure, but likely not. It sounds like your client may have been relying on one of the optimization add-ons that are automatically installed with Excel[1][2], rather than actual Excel features. The company that makes those add-ins has developed new versions that work with Excel Online, but add-ins in Excel Online execute in the local browser context. So I don't think they're loaded/usable when you create a headless workbook session via the Graph API (although I've never actually tried to do that, so could be wrong).
That said, Frontline Systems (the company that makes those Excel add-ins) does have a web API[3]. The optimization models there are a superset of the capabilities in the Excel add-ins, so your client's Excel optimization model could likely be ported over to that pretty easily.
[1] https://support.microsoft.com/en-us/office/use-the-analysis-...
[2] https://support.microsoft.com/en-us/office/define-and-solve-...
The problem is handling Excel instances.
Build a backend for Excel
Also, one thing I always find challenging when applying formulas to a column is applying it to the entire column. Either you remember to copy and paste it when you add a new row, or you drag it down to row 10000 and then have a bunch of formula errors because your data doesn’t have that many rows. Or add if(empty()) prefixes which makes them much harder to read. Any better way around that?
Given the existing wonkiness of the excel formula programming model, anyone who already had a grasp of actual tables and array formulas (which to be fair, is already a small subset of excel formula users) will be able to pick up these pretty easily.
As someone using Excel to do slot game mathematics calculations, sometimes the excel formulas used are very long, convoluted, and hard to grok when coming back to them. Many cells often exist as calculation cells only, used for intermediate steps which leads to even more logic complexity.
I’m excited to experiment with these to try and simplify some of the long, previously-deemed-necessary calculation methods.
Why?
https://www.youtube.com/watch?v=Rm4y5UqauRw
https://www.youtube.com/watch?v=L7s6Dni1dG8
Demonstrably false.
What has instead happened, I shit you not, is we have "Excel influencers" teaching people recursion "without code!" (aka without VBScript).
I cried and I laughed when I first saw, it was a watershed moment in CS education.