TablePress has a really neat feature that many people like, once they find out about it: You can use mathematical functions and formulas in your table cells, in a very similar way as you can use them in Excel or other spreadsheet applications.

To show you what I mean, here’s a quick example of a table that contains some made-up data, and some formulas that calculate something:

A | B | C | D | |
---|---|---|---|---|

1 | Data 1: | Data 2: | Formulas: | Result: |

2 | 1 | 0.4 | =A2+A3+A4 | 8 |

3 | 2 | -0.9 | =Sum: {SUM(B2:B8)} | Sum: 11.5 |

4 | 5 | 4.5 | =SIN(PI()/2) | 1 |

5 | 4 | -0.1 | =ABS(B3)+CEIL(B4) | 5.9 |

6 | 3 | 2.2 | =POWER(A4,A5) | 625 |

7 | 7 | -0.4 | =MEDIAN(A2:A8) | 4 |

8 | 8 | 5.8 | =IF(A4>A5,1,0) | 1 |

The content of a cell is evaluated as a formula, if it starts with the equal sign `=`

.

The nice thing in the formulas is that you can use references to other cells, by stating the column letter and the row number. You can either use single references, like `A2`

, or reference multiple cells in a row, column, or even block, by using the colon (`:`

) operator. With that, `A2:A8`

means all cells in the `A`

column, while `A3:E3`

would refer to all cells in the third row.

Those references will even be adjusted automatically whenever the referenced cell changes position in the table, e.g. because its row or column is moved or because another row or column is deleted or inserted.

Also, it is possible to wrap a formula in text, with the syntax `=TEXT{FORMULA}TEXT`

. The cell content still has to start with the equal sign `=`

and the formulas then have to be wrapped in curly brackets `{`

and `}`

. This can be seen in the example `=Sum: {SUM(B2:B8)}`

in cell C3 in the table above.

There are multiple functions available:

#### Math operators:

`+` | addition |

`-` | subtraction |

`*` | multiplication |

`/` | division |

`^` | power |

#### Comparison operators:

`=` | equal |

`<` | smaller than |

`>` | greater than |

#### Basic math functions:

`sqrt(` | Square root of x |

`abs(` | Absolute value of x |

`ln(` | Natural logarithm of x (Logarithm of )x to the base e |

`log(` | Logarithm of x to the base b |

`log10(` | Logarithm of x to the base 10 |

`exp(` | Exponential function |

`floor(` | Greatest integer that is smaller or equal to x |

`ceil(` | Smallest integer that is greater or equal to x |

#### Statistics functions:

`average(` (also as `mean(` ) | Average value of the arguments |

`median(` | Median value of the arguments |

`mode(` | Mode value (most common value) of the arguments |

`range(` | Range: Difference between the largest and smallest arguments |

`max(` | Largest value of the arguments |

`min(` | Smallest value of the arguments |

`mod(` | Remainder of the division x divided by y |

`pi()` | Value of π (3.14159…) |

`power(` | Value of the x raised to the yth power |

`round(` | Round x to the precision p (The default p=0 will result in an integer.) |

`number_format(` | Formats x with d decimals after the period . where the comma , will be used as the thousands delimiter (if x has more than four digits) |

`number_format_eu(` | Formats x with d decimals after the comma , where the period . will be used as the thousands delimiter (if x has more than four digits) |

`sum(` | Sum of the arguments |

`product(` | Product of the arguments |

`rand_int(` | Random integer between a and b |

`rand_float()` | Random real number between 0 and 1 |

`if(` | If condition is true, then will be returned, and else otherwise |

#### Trigonometric functions:

`sin(` | Sine of x |

`sinh(` | Hyperbolic sine of x |

`arcsin(` ( also as )`asin(` | Inverse sine of x |

`arcsinh(` ( also as )`asinh(` | Inverse hyperbolic sine of x |

`cos(` | Cosine of x |

`cosh(` | Hyperbolic cosine of x |

`arccos(` ( also as )`acos(` | Inverse cosine of x |

`arccosh(` ( also as )`acosh(` | Inverse hyperbolic cosine of x |

`tan(` | Tangent of x |

`tanh(` | Hyperbolic tangent of x |

`arctan(` | Inverse tangent of x |

`arctan2(` ( also as )`atan2(` | Inverse tangent of the quotient x/y, while taking the sign into account |

`arctanh(` | Inverse hyperbolic tangent of x |

Most of them expect only one argument, either a number, or a reference to a cell, while some of the functions will work with multiple arguments, either given as a comma-separated list, or by using the colon operator that is described above.

If this feature is helpful for you, please consider supporting further TablePress development with a donation. Thank you!