0

I've got this Exhibit A in brute force for a rate that is halved after 10 minutes

#+NAME: ratetable
| 0 min | 10 min | 20 min | 30 min | 40 min | 50 min |
|  20.0 |    10. |     5. |    2.5 |   1.25 |  0.625 |
#+TBLFM: @2$2=@2$1/2::@2$3=@2$2/2::@2$4=@2$3/2::@2$5=@2$4/2::@2$6=@2$5/2

What I'd really like is a way to put in just one starting value in the second row/first column and have the rest of the row populated without all the individual formulae per cell. Any ideas/docs talking about this sort of "amortize(?) the whole row/column" would be appreciated.

0
1

You can use a range formula for cases like this. The relevant section in the manual, which you can get to with C-h i g (org) Field and range formulas, says:

‘@1$2..@4$3=’

Range formula, applies to all fields in the given rectangular 
range.  This can also be used to assign a formula to some but not 
all fields in a row.

That, combined with relative references (C-h i g (org) References) , allows to write the above set of formulas as a single formula:

#+TBLFM: @2$2..@2$> = @2$-1/2

In words: for every cell in the second row @2, starting with the second column $2, and ending with the last column $>, set its value to be the value of the cell in the second row but the previous column $-1, divided by 2.

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.