# poi-user mailing list archives

##### Site index · List index
Message view
Top
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: poi: Simple Excel Array Formula Fails in POI
Date Sat, 10 Nov 2018 13:48:48 GMT
```I confirmed the bug and it smells like a problem in the IF function.
Somehow the result depends on evaluation of the 1st element of the input
array.

Given A1:A6

5
10
15
20
25
30

POI evaluates {=IF(A1:A6>=6,A1:A6)} to all FALSE's :

FALSE
FALSE
FALSE
FALSE
FALSE
FALSE

while Excel evaluates it to

FALSE
10
15
20
25
30

In the example above the 1st element of the array evaluates to FALSE and
the evaluation goes wrong after it.

Compare with an example when  the 1st element of the array evaluates to
TRUE: {=IF(A1:A6>=3,A1:A6)} . In this case POI evaluates it correctly:

5
10
15
20
25
30

Can you please create a ticket in Bugzilla and attach the code from Github
to it?  It's a pretty major bug and I hope we'll fix it shortly.

Regards,
Yegor

On Mon, Nov 5, 2018 at 1:19 PM Stephen Friedrich <
Stephen.Friedrich@mgm-tp.com> wrote:

> In our project we use POI to "calculate" an Excel workbook that is managed
>
> In the last revision we had very strange results and I tracked it down to
> POI not really supporting array formulas.
> I made a test excel and project where it fails for this simple formula
>
>     { =MIN(IF(A1:A6>=C1;A1:A6)) }
>
> The strange thing is that it works sometimes, but fails for other values.
> If this is not supported I would be OK with a hard failure as soon as the
> formula is evaluated.
> But here there are no exceptions at all, but the formula just gives wrong
> results for some values.
>
> See the example project including an automated test at
> https://github.com/eekboom/poi-minif
>
>

```
Mime
• Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message