Hmm. This is not a problem with the compiler as such, but with the
underlying JExcelAPI library we use to parse .xls files. So, to narrow
this down, can you either post the sheet, or add a breakpoint in
> org.formulacompiler.spreadsheet.internal.excel.xls.loader.ExcelXLSLoader.loadCell(ExcelXLSLoader.java:
> 181)
and then evaluate `exprCell.getCellIndex()`. That should tell you the
cell whose formula cannot be parsed. I would then be interested in
that formula or, if you can narrow it down, the part of it that does
not work.
I've also opened a ticket that we should indicate the problematic
cells in such error messages:
https://www.formulacompiler.org/trac/ticket/27
-parren
We're going to look into supporting these. But thanks for considering it!
Meanwhile, the definitive reference for what's supported is:
http://www.formulacompiler.org/doc/reference/index.htm
Using a text search on this page should quickly tell you whether a
particular function is supported.
>
> (One funny thing - formulacompiler seems to evaluate every expression
> in the workbook, regardless whether it's referenced by the output
> cells' cell chain back to input or not.)
Hmm. Good point. Right now it is only lazy about parsing required
formulas from the textual form to its own internal AST. But it has
JExcelAPI parse all formulas from Excel's internal format to textual
form.
http://www.formulacompiler.org/trac/ticket/28
>
> That's the bad news. The worse news is I'm getting the following
> runtime exception (full stack trace elided for clarity - it's 150+
> lines, and I can provide whatever necessary) -
>>
> Exception in thread "main"
> org.formulacompiler.compiler.CompilerException$UnsupportedExpression:
> Index: 46, Size: 0
> Cell containing expression is 'io1'!B19.
> Referenced by cell 'io1'!B19.
>>
>
Strange. We do support this form:
http://www.formulacompiler.org/doc/reference/lookupfuncs.htm#pagetoc__1_3
Could it be any of the cells in P19:P27 is the culprit?
> FWIW, the expression in this cell is =MATCH(1,P19:P27,0) - and if I
> replace it with its value it handles it ok, but at that point the same/
> similar exception is thrown for another cell that is simply a
> reference to a cell on a separate sheet.
Would this be one in P19:P27, or referenced from them?
> One other thing, excel
> blew up in the middle of all my bulldozing. It recovered OK, but it
> may be the reason somehow for this. I'll start a fresh run of all my
> changes if it seems like this could be the culprit. I may do it
> anyway, seeing as how much fun it was the first time :-P
>
> I appreciate any guidance I can get on missing formula implementation,
> or this funky exception.
-parren
Well, there is a ton of developer documentation at
http://www.formulacompiler.org/contribute/hacking/index.htm
which should get you up to speed. However, supporting array formulas
is a tough call as it entails extending the formula parser in
JExcelAPI as well as adding new concepts to the compiler in AFC. So
this unfortunately goes way beyond what we expect casual users to be
able to contribute.
Anyway, one of us is right now tackling MDETERM(), which is not an
array function.
> Very cool, thanks. Of course that prompts the question "any idea when
> 1.1.1 may be expected?" question is inevitable.
No fixed schedule, but I guess we could release once we manage to
solve your problems. ;)
Ah, this is interesting. Shall investigate.
> 3) I replaced this method with its return value, and find the blowup I
> reported last time:
> Exception in thread "main"
> org.formulacompiler.compiler.CompilerException$UnsupportedExpression:
> Index: 46, Size: 0
> Cell containing expression is 'io1'!B19.
> Referenced by cell 'io1'!B19.
>
> The expression in B19 is =INDEX(Q19:Q27,$P$30)
>
> The expression in P30 is =MATCH(1,P19:P27,0)
>
> The expressions in Q19:Q27 are all of the form ='m1'!D6
> The expressions in P19:P27 are all of the form =IF(R19<P$18,1,0)
>
> Nothing obvious, to me.
Nor, sadly, to me.
>
> Not sure if its pertinent, but B19 is a (named) output cell.
>
> Lots of questions, few clues. But to summarize:
> My proprietary workbook has a few unsupported features (MDETERM,
> MINVERSE) and it also blows up when apparently only supported features
> exist.
>
> Seems like the only forward path on the second part of the problem is
> to get clearance to share the file. Let me know and I'll get started
> on that.
> [...]
> Yeah, there's dim chance of that at this time.
That would certainly have been the most promising option. :(
> are their extra debugging tools etc. available so I can dig deeper and
share what I get?
Not exactly. We are developing a tracing mode for computed engines
right now, but this won't help in your case anyway. Can you try to
reproduce the problems in a simplified and shareable sheet? Meanwhile,
I'll be trying to reproduce this myself, too.
I appreciate your tenacity.
-parren
I have reproduced this problem. We're not parsing off-sheet ranges correctly.
http://www.formulacompiler.org/trac/ticket/29
-peter
We have a fix for this. To try it please download
http://arrenbrecht.ch/misc/formulacompiler-1.1.0.1-hotfix.zip
which contains a bunch of updated .jar files.
Thanks,
-peter
http://www.formulacompiler.org/trac/ticket/30
> Seems like it's best to stand down and wait until we see what will
> happen with array expressions, or at least until the workbook settles
> down. At that point it would be safe for me to try to substitute out
> unsupported stuff with fungible, supported alternatives.
Sounds reasonable.
Cheers,
-peter