2

I am having hard time trying to figure out how to add contents of multiple fields.

It isn't quite obvious from Org mode manual as issue like this should be.

I'm trying to find a formula to sum the entry in fields @2$5 to @5$5 and make an entry of the sum in @6$5.

Now I found that something like @2$5..@5$5 can be used to refer to range of fields, but how do I find the sum of them?

I tried sum(@2$5..@5$5) and add(@2$5..@5$5), but apparantly there's no such functions.

3

The formulas are evaluated by the calc package, and its manual is the goto place for functions lookup. (This manual can be quite overwhelming, but you will only visit a few pages most of the time.)

Usually, functions that operate on a single vector (in your case you want to sum coefficients of a vector) are prefixed by v, and indeed here vsum is what you're looking for.

You can find a list of these functions here.

2

If you're more comfortable with elisp than calc functions, you can also do something like this:

'(apply #'+ '(@2$5..@5$5));N

See the Org manual for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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