2

To add the values in B2:B5 in ses-mode I would write either

(+ B2 B3 B4 B5)

or

(apply '+ (ses-range B2 B5))

simple table

but how can I generate the values in the range C2:C5 from B2:B5?

1 Answer 1

2

From the to-do list at the start of the ses.el we find: "Allow paste of one cell to a range of cells -- copy formula to each." Indicating that this functionality has not been implemented yet.

I guess that would be, more or less, the functionality you are looking for. To me, it looks like the ses library, unfortunately, is not very useful yet, and that the development of the library has never been completed.

However, for the simple example above, I think Org mode tables provide a perfectly working alternative solution. Open a buffer named foo.org and enter the following:

| Month | Value | Amount |
|-------+-------+--------|
| Jan   |    23 |        |
| Feb   |    34 |        |
| Mar   |    45 |        |
| Apr   |    56 |        |
#+TBLFM: $> = $>> / 10

Start Calc with M-x calc and then press C-c C-c on the #+TBLFM line to fill out the third column. The formula applies to the whole column and is read as "fill out the last column from the corresponding entry of the penultimate column, divided by 10."

The nicer alternative probably would be to add the functionality to the ses library, but that does not look super easy to me (also not super hard).

3
  • @NickD Thanks, for the 'edit'! Commented Nov 23, 2022 at 16:39
  • I figured that a simple example might convince the OP - if you ever find my meddling irritating, please let me know!
    – NickD
    Commented Nov 23, 2022 at 16:58
  • Sure! However, generally I find that you are doing a great (and sensible) job! So don't hesitate :) Commented Nov 23, 2022 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.