The problem#
I mostly use Gnumeric for my personal spreadsheets, which
are generally quite simple. But recently I wanted do some analysis
that required writing a formula more complicated than just using the
SUM()
function and found Gnumeric's function documentation
quite lacking in sufficiently detailed explanations and examples to be
able to figure out how to use any of the more complicated functions.
The specific problem I was trying to solve was that I had some data on payments over time labeled with categories and wanted to summarize payments by category for each time period.
The solution#
The short version is that Gnumeric's formula language is nearly the same as Microsoft Excel's formula language, so there's no need to look for Gnumeric-specific help on writing formulas. There's plenty of advice online on writing formulas for Excel, and the information transfers without modification to writing formulas for Gnumeric.
For my specific problem, my layout was that each column was a time
period and each row was a payee with column A
being the name of the
payee and column B
being the category. I made entries further down in
column A
of the categories and wanted the cells in those rows to be
the sum of the payments for the corresponding column's time period but
only for the payees matching the category for the row. The function to
do that is called SUMIF()
, but that documentation
page from Gnumeric is very unhelpful except for the line
This function is Excel compatible.
The Excel help page on SUMIF()
has examples and a lot
more explanation. Here's what the formula looks like in cell P50
:
=SUMIF($B$2:$B$40,$A50,P$2:P$40)
where B2:B40
is the range where the categories are given for each
payee (named in A2:A40
), A50
contains the category being summed, and
P2:P40
contains the actual values being conditionally summed (i.e.,
the values for the time period named in P1
).