Two notes to answer your questions.
The first answers your question directly. Take a look at The Org Manual and its section on References.
In short: use @> to refer to the last row.
The example provided in the manual says:
@>$5 [refers to the] field in the last row, in column 5
Referring to the last-to-one row is not possible in this way, as far ...
This seems to work for me:
| plan | a | b | c |
| concern 1 | -1 | 0 | 2 |
| concern 2 | 2 | 1 | 1 |
| concern 3 | 0 | 2 | 1 |
| score: | 1 | 3 | 4 |
$<<..$> means "the range of columns starting from the second and up to the last."
If you're just using constants, like your example 13*57, and not referring to other cells in the org table, you can use quick-calc to do this calculation.
M-x quick-calc reads an expression from the minibuffer, calculates it, and displays the result in the minibuffer.
inserting at point
With a prefix argument, it will also insert the ...
Your guess inner is right. The first two operands of inner are the multiplication and the summation operator, respectively. The remaining two arguments are the vectors for the inner product.
The summation operator is add and the multiplication operator is mul.
Your table inclusive the table-formula should look like:
| | | col1 | enable |
You are probably better off using Lisp formulas for things like this. As @db48x's answer points out, there are a couple of cooks in that kitchen and what they are doing is not always obvious. Formula debugging can help but it is not always effective (I presume that's how @db48x discovered the "(a)" thing, but that may not be the case).
I find the ...
I don't know well the formula syntax for calc, but it seems that if you follow exactly the syntax of string constant that the documentation uses, it will work. Namely, replace '' by "":
#+TBLFM: $5 = if($4 < 2, test, string(""))
Can't explain why, though. There is also a formula syntax for Emacs Lisp that you might find more intuitive....
I don't know exactly what's going on here, but after doing a little debugging I found that this works:
| a | |
| b | |
#+TBLFM: $2=if("$1"=="(a)", 1, 0)
It looks to me like it's doing algebraic simplification in order to get an answer, and if that fails it can be left with a more complicated form than you expected. b = a ? 1 : 0 is a ...
As of org-mode 9 you can only do this manually: Place the cursor on the respective #+tblfm: lines and press C-c C-c. Here's the corresponding manual section, which is telling you that org considers only the first #+tblfm: line when otherwise updating the table formulas.
When the amount of formulas is getting too cumbersome to edit the #+tblfm: line itself ...
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 ...
Basically every table manipulating function is updating formulas. For example : M-S-right includes a new column (before the cursor) updating formulas to the new number of columns.
C-u C-c * is recalculating all your formulas in the spreadsheet.
Also a C-c C-c on a #+tblfm: line is (re)applying all the formulas in the table.
For more advanced stuff, like ...
Simulate LHS Column Name Assignments
Simulate Left Hand Side (LHS) column name assignments using named fields and a keyboard macro.
Update your example table and formulas as follows:
| | Runde | 0 | 1 | 2 | Resultat | % |
| ! | | c0 | c1 | cn | | |
| _ | name | ...
Everything is possible since you can arbitrarily modify a buffer temporarily before applying a command with cmdbufmod from the answer to the question about a single tblfm for multiple org tables.
The following code defines an :around advice org-table-multi-tblfm for org-table-recalculate that joins successive #+TBLFM:-lines before running org-table-...
You could use the lisp function memq for the lookup as demonstrated in the Org example below.
I use the Literal mode switch L.
This imposes the restriction that there are only one-word identifier in the food column.
Furthermore I use quote to avoid evaluation of the symbols in the table formula.
Please, use the table debugger to see what is going on (Tbl ...
"precision" refers to the number of floating point digits Calc does its internal computations with. The floating point format specifies how many digits to print after the decimal point. The default value is
calc-float-format (float 8)
org-table-sort-lines does not return the sorted table as your first formula assumes: instead, it operates by side-effect, modifying the table in place. It just so happens that the last thing it calls is (move-column 2) to move the cursor to the second column (of the screen, not the table - I'm oversimplifying here, but the details really don't matter much), ...
The Org mode spreadsheet is not like Excel: you don't create formulas in one cell and then propagate them to other cells (well, you can - do C-h i g (org)Field and range formulas, but propagating them is basically a matter of cutting and pasting). You can instead use a #+TBLFM after the table to do all that:
You can either use the calc syntax or the elisp syntax.
| x | calc syntax | elisp syntax |
| 1 | 0 | 0.0000 |
| 2 | 0.6931 | 0.6931 |
#+TBLFM: $2=log($1);n4::$3='(log $1);N%.4f
Notice that the output format of the calc syntax depends on the ~/.emacs.d/calc.el parameters.
I have found a satisfactory solution (of a sort) to the problem, without being able to exactly diagnose it, as explained in the above Update. The code I added to my .emacs file (which was needed anyway in order to avoid a frustratingly repetitive safety dialogue) is as follows:
;; load the code file defining the printer function num-to-cash
Defining Constant Values from Remote Org-Table Cell for Use in #+TBLFM:
Create Named Table, e.g. other-table-name
| S | M | T | W | H | F | S |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 |
Method 1 - Dynamically Define #+CONSTANTS: using SRC Block Results
In this example, the programming language used ...
You may try the orgtb-aggregate package available on Melpa. It will create new tables from yours. In this example, partial sums are computed for similar values of enable:
| | | col1 | enable |
| | | 1 | 1 |
| | | 3 | 0 |
| | | | 0 |
| | | 7 | ...
OK. My fault.
When I was revising the proposal of @Melioratus, I noticed that in some formulas I was not including the two dots to indicate range, specifically in the calculation of the fields that yield =nil=.
Here are the original formulas:
#+TBLFM: $5='(org-lookup-first $no '(remote(E1Ap1,@I$no@II$no)) '(remote(E1Ap1, @I$tot..@II$tot))) :: $6='(org-...
if the formula in cell C1 is (+ A1 B1), I would like to be able to copy the formula from C1 into C2 and have the formula be (+A2 B2) instead of (+ A1 B1).
That's how it does work, though.
If I set a formula (+ A1 B1) in cell C1, then mark and copy that cell, and yank it into cell C2, the resulting formula in C2 is (+ A2 B2).
This is using C-SPC <right> ...
I subscribe to https://emacs.stackexchange.com/users/454/phils 's recommendation to file a bug report.
In the meantime you could try this slightly modified version of ses-mark-column.
(defun ses-mark-column ()
"Mark the entirety of current column as a range."
(let ((col (cdr (ses-sym-rowcol (or (car-safe ...