Question

I have been trying to simplify a semi-complex table that I have by adding named fields, without a problem, until I get to the vsum operator. I had the formula set to $M=vsum($3..@-4) which works, however I am continuously having to add and remove items from those fields, which changes the column numbering. This results in me having to change the field specifications of the vsum range after every update/change. I thus tried naming the top field and bottom fields with the thought of supplying the named variables to vsum, giving me a table similar to the following:

| / | <>     | <>      |
|---+--------+---------|
|   | Title1 | Title 2 |
|---+--------+---------|
| _ |        | START   |
|   | name   | 1000    |
|   | name   | 3456    |
|   | name   | 123     |
| ^ |        | END     |
|---+--------+---------|
| _ |        | MT      |
| # | Total  | #ERROR  |
| # |        |         |
|---+--------+---------|
#+TBLFM: $MT=vsum($START..$END)

This is the debug formula output from the above table: Substitution history of formula Orig: vsum($START..$END) $xyz-> vsum((1000)..(123)) @r$c-> vsum((1000)..(123)) $1-> vsum((1000)..(123)) -----------^ Error: Expected `)'

I have tried embrasing the named field variables in parenthesis, and several other ways but have thus far not been able to get this to work. I am hoping I am just missing something and being blind, but perhaps this is not possible to do?

I have also tried the sum-up function with no success as well. Thank you in advance for your assistance.

No correct solution

OTHER TIPS

The following solution works by using @II and @III to refer to all entries between the second and third hline.

| / | <>     | <>      |
|---+--------+---------|
|   | Title1 | Title 2 |
|---+--------+---------|
|   | name   | 1000    |
|   | name   | 3456    |
|   | name   | 123     |
|---+--------+---------|
| _ |        | MT      |
| # | Total  | 4579    |
| # |        |         |
|---+--------+---------|
#+TBLFM: $MT=vsum(@II..@III)

Documentation: http://orgmode.org/manual/References.html#References

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top