(e-mail address removed) wrote...
....
I am not adding a scalar to an array I am adding arrays of equal size
and I would expect that excel returns an array. If it does not then it
is unexpected behaviour. Using the same logic I opened the same file
in OpenOffice calc and it works... Maybe microsoft logic is a little
different to mine.
I was providing the simplest example of an array expression derived
from a range - a range plus a scalar. If you'd prefer a more
complicated example closer to your original formula, here goes.
In OpenOffice Calc 2.4.0, I have the following in A1:C12.
06/26/2008 06/27/2008 2
06/27/2008 06/27/2008 4
06/27/2008 06/27/2008 3
06/26/2008 06/27/2008 1
06/27/2008 06/28/2008 6
06/27/2008 06/29/2008 4
06/26/2008 06/28/2008 1
06/27/2008 06/27/2008 5
06/26/2008 06/26/2008 4
06/27/2008 06/27/2008 3
06/27/2008 06/29/2008 5
06/27/2008 06/27/2008 4
And I have 06/26/2008 in A14 and 06/27/2008 in B14. If I enter the
following REGULAR formulas
E2: =MAX((A1:A12>A14)*(B1:B12<=B14)*C1:C12)
E3: =MAX((A1:A12>A14)*(B1:B12<=B14)*C1:C12)
then - SURPRISE! SURPRISE! - E2 evaluates to 4 and E3 to 3. OTOH, if I
enter either formula AS AN ARRAY FORMULA then they return the correct
result: 5. FWIW, the OpenOffice Calc 3.0 beta reproduces these EXACT
SAME results.
So while you could use OpenOffice to do this, what *YOU* seem
unwilling to understand is that OpenOffice Calc works EXACTLY THE SAME
AS EXCEL when evaluating array formulas like these. If you really want
the correct result most of the time rather than occasionally by happy
accident, *YOU* need to enter such formulas *BOTH* in Excel *AND*
OpenOffice Calc as ARRAY FORMULAS.
FWIW, gnumeric 1.9.1 returns the same result as Excel and OOo Calc. In
my experience, only the Applix Spreadsheet (Applixware running on
Linux) would have evaluated this sort of formula correctly when not
entered as an array formula because it's the only spreadsheet I've
used that didn't provide array formulas distinct from regular formulas
but did evaluate derived arrays the same as they would have been
evaluated in Excel array formulas. I suppose it's possible Quattro Pro
would also evaluate this correctly using
@ARRAY(@MAX((A1..A12>A14)*(B1..B12<=B14)*C1..C12), but I gave up on QP
before I had torture tested its @ARRAY. If the range above had been in
A2:C13 rather than A1:C12 and had had column labels in A1:C1 like
StartDate, EndDate, Amount, this could have been done in Lotus 123
Release 3.0 and later as
@DMAX(A1:C13,"Amount",(StartDate>$A$14)#AND#(EndDate<=$B$14))
Don't BS about other spreadsheet programs in this newsgroup.
So still user error rather than a bug, whether in Excel or OOo Calc. A
fine example of none so blind as those who will not see.