A formula like
(+ A1 A2 A3)
is the sum of three specific cells. If you insert a new second row, the formula becomes
(+ A1 A3 A4)
and the new row is not included in the sum.
(ses-range from to
) evaluates to a list of
the values in a rectangle of cells. If your formula is
(apply '+ (ses-range A1 A3))
and you insert a new second row, it becomes
(apply '+ (ses-range A1 A4))
and the new row is included in the sum.
While entering or editing a formula in the minibuffer, you can select a range in the spreadsheet (using mouse or keyboard), then paste a representation of that range into your formula. Suppose you select A1-C1:
If you delete the from or to cell for a range, the nearest still-existing cell is used instead. If you delete the entire range, the formula relocator will delete the ses-range from the formula.
If you insert a new row just beyond the end of a one-column range, or a new column just beyond a one-row range, the new cell is included in the range. New cells inserted just before a range are not included.
Flags can be added to
ses-range immediately after the to
!flag. An empty cell is a cell the value of which is one of symbols
*skip*. For instance
(ses-range A1 A4 !)will do the same as
(list A1 A3)when cells
_is last in argument list. For instance
(ses-range A1 A4 _ "empty")will do the same as
(list A1 "empty" A3 "empty")when cells
A4are empty. Similarly,
(ses-range A1 A4 _ )will do the same as
(list A1 0 A3 0).
*except that a matrix is always made even when there is only one row or column in the range.
*except that a vector is always made even when there is only one row or column in the range, that is to say the corresponding matrix is flattened.