[Linux-disciples] Array formulas in Gnumeric
Stephen R Laniel
steve at laniels.org
Wed Sep 14 11:21:36 EDT 2005
In MS Excel, there's a nice little feature called an
'array formula', which allows you to enter formulas
like so:
=SUM(IF(A1:A1000<=2,1,0))
Then you press Ctrl+Shift+Enter, and Excel iterates the
formula you entered over the cells you entered. In this
case, it would find all the cells between a1 and a1000 that
are less than or equal to 2, and report their total. This is
damned handy for, say, building your own histograms:
A B C
1 Data Bins Histo
2 1.50 0 =sum(if(and($A$2:$A$30000>=B2,$A$2:$A$30000<B3),1,0))
3 2.64 0.04 =sum(if(and($A$2:$A$30000>=B3,$A$2:$A$30000<B4),1,0))
6 2.16 0.16 =sum(if(and($A$2:$A$30000>=B6,$A$2:$A$30000<B7),1,0))
[...]
I mention this only as a prelude to investigating the same
feature in Gnumeric. As far as I can tell, it's documented
here:
http://www.gnome.org/projects/gnumeric/doc/sect-data-formulas.html
Check out the relevant part:
"5.2.4.5Array Formulas
It is periodically useful or necessary to have an expression
return a matrix rather than a single value. The first
example most people think of are matrix operations such as
multiplication, transpose, and inverse. A less obvious usage
is for data retrieval routines (databases, realtime
data-feeds) or functions with vector results (yield curve
calculations).
Entering an Array Formula
An array formula is currently entered by selecting the
single range in which to store the result, entering the
array formula, and hitting the key combination,
Ctrl+Shift+Enter.
The result is displayed as :
={FUNCTION(ARGUMENTS)}(num_rows, num_cols)[row][column]"
That is some awful documentation. It needs examples. It is
wholly unclear what, exactly, an array formula is for here.
And the syntax seems less clear than Excel's. I would
rewrite their documentation for them, if I knew how to do
the thing I'm trying to do.
Does anyone know how to do array formulas in Gnumeric? If
anyone does, and can explain it well enough for me to do it,
I'll gladly fix GNOME's documentation.
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050914/87f9f158/attachment.pgp
More information about the Linux-disciples
mailing list