2014-02-15 18:14 GMT+01:00 Cecil Westerhof <cldwester...@gmail.com>: > 2014-02-15 16:19 GMT+01:00 Michael Brand <michael.ch.br...@gmail.com>: > > What about this?: >> >> |--------------+------+-----| >> | activity | Time | sub | >> |--------------+------+-----| >> | Activity A | 3 | | >> |--------------+------+-----| >> | Activity B | 5 | 34 | >> | Activity C | 2 | 34 | >> | Activity D | 7 | 34 | >> | Activity E | 8 | 34 | >> | Activity F | 12 | 34 | >> |--------------+------+-----| >> | Activity 1 | 9 | 18 | >> | Activity 2 | 2 | 18 | >> | Activity 3 | 4 | 18 | >> | Activity 4 | 3 | 18 | >> |--------------+------+-----| >> | Activity I | 23 | 111 | >> | Activity II | 51 | 111 | >> | Activity III | 37 | 111 | >> |--------------+------+-----| >> | | 163 | | >> |--------------+------+-----| >> #+TBLFM: @>$2 = vsum(@<<<..@>>) :: @<<<$3..@>>$3 = vsum(@-I$2..@+I$2) >> > > It is certainly a big step in the right direction. I have to study it to > understand what it does. (You also changed the part I already had. I have > to look to see why that is better.) > > There are a few problems with it: > - As your example shows, the first element is not filled and when the > first range only has one element ... > - I would like to have only the last element of the range filled. > > But it is certainly helpful: thanks. >
When looking better I saw there was a nasty bug. The following works and gets rid of the first 'problem': |--------------+------+-----| | activity | Time | sub | |--------------+------+-----| | Activity A | 3 | 3 | |--------------+------+-----| | Activity B | 5 | 34 | | Activity C | 2 | 34 | | Activity D | 7 | 34 | | Activity E | 8 | 34 | | Activity F | 12 | 34 | |--------------+------+-----| | Activity 1 | 9 | 18 | | Activity 2 | 2 | 18 | | Activity 3 | 4 | 18 | | Activity 4 | 3 | 18 | |--------------+------+-----| | Activity I | 23 | 111 | | Activity II | 51 | 111 | | Activity III | 37 | 111 | |--------------+------+-----| | | 166 | | |--------------+------+-----| #+TBLFM: @>$2 = vsum(@<<..@>>) :: @<<$3..@>>$3 = vsum(@-I$2..@+I$2) -- Cecil Westerhof