ses: Spreadsheets with details and summary
4.8 Spreadsheets with details and summary
=========================================
A common organization for spreadsheets is to have a bunch of “detail”
rows, each perhaps describing a transaction, and then a set of “summary”
rows that each show reduced data for some subset of the details. SES
supports this organization via the ‘ses-select’ function.
‘(ses-select FROMRANGE TEST TORANGE)’
Returns a subset of TORANGE. For each member in FROMRANGE that is
equal to TEST, the corresponding member of TORANGE is included in
the result.
Example of use:
(ses-average (ses-select (ses-range A1 A5) 'Smith (ses-range B1 B5)))
This computes the average of the B column values for those rows whose
A column value is the symbol ’Smith.
Arguably one could specify only FROMRANGE plus TO-ROW-OFFSET and
TO-COLUMN-OFFSET. The TORANGE is stated explicitly to ensure that the
formula will be recalculated if any cell in either range is changed.
File ‘etc/ses-example.el’ in the Emacs distribution is an example of
a details-and-summary spreadsheet.