News for hackers. Stuff that matters.
Re:XLParser: A C# parser for Microsoft Excel formulas by jimmcslim on Sunday September 27, 2015 @05:37AM (#10285998)
Interesting. I would have thought that Excel formulas would be relatively easy to parse, but they with things like array formulas, etc it could start to get a bit hairy.

This might be very useful for a project I have coming up, so I'll definitely look at it further!

Re:XLParser: A C# parser for Microsoft Excel formulas by dtech on Sunday September 27, 2015 @07:08AM (#10286164)
The basics are very simple, but there are some very intricate rules/quirks...

For example, the following are valid formulas:

    `=SUM(IF(TRUE,A2,C7):C10)`
    `=SUM(A1:B3:C2)`
    `=SUM(A1,,,,,,A2)`
    `=SUM((A1,A2),A3)` means something different than `=SUM(A1,A2,A3)`, both are valid
    `=SUM(A:A 1:1)`
We still have only <<100 production rules while the official Microsoft one has hundreds. If you don't care about the complicated structures (and our research indicates that they are very rarely used) you can make the grammar a lot simpler.