---
title: Calculations and Diagrams
tags: [example, calculation, diagram]
---
# Calculations and Diagrams
## Calculations in a sentence
Write an expression in `${...}` and it is shown as its result. For example ${(4+2)*3/2} is shown as 9, and rounding is written like ${ROUND(10/3, 2)}. ${1/0}, which cannot be worked out, is shown as written. In Live Preview a calculated value has another colour and a dotted underline, and the expression comes back when the cursor is in it.
## Calculations in a table
The columns of a table are A, B, C ... and the rows are 1, 2, 3 ... from the header; the names are shown above and at the left of the table. Use a cell as `B2` or a range as `B2:B3`, and use the results of other cells.
| Item | Count | Price | Amount |
|---|---|---|---|
| Apple | 3 | 1200 | ${B2*C2} |
| Pear | 2 | 3000 | ${B3*C3} |
| Total | ${SUM(B2:B3)} | ${AVERAGE(C2:C3)} | ${SUM(D2:D3)} |
| Verdict | | | ${IF(D4>=9000, "over budget", "within budget")} |
The functions: `SUM`, `AVERAGE`, `COUNT`, `COUNTA`, `MAX`, `MIN`, `IF`, `SUMIF`, `COUNTIF`, `AND`, `OR`, `NOT`, `LEFT`, `RIGHT`, `MID`, `TRIM`, `ROUND`, `ROUNDUP`, `ROUNDDOWN`, `TRUNC`, `INT`, `TODAY`, `NOW`. When a column or a row is dragged to another place, its name changes to fit the new place.
## Diagrams
A code block marked `mermaid` is drawn as a picture. You can also pick one from the diagram button of the toolbar.
```mermaid
flowchart LR
A[Idea] --> B{Worth it?}
B -- Yes --> C[Write a note]
B -- No --> D[Think again]
```
## Editing tips
- When you delete an item in the middle of a numbered list, the numbers after it follow on by themselves. Delete the second line of the list below.
1. First
2. Second
3. Third
4. Fourth
- A heading (`#`) lets you fold what is below it. When folded, an arrow shows before the heading; while it is open, pressing where the arrow would be folds it too.
- A picture can stand at the left, centre or right of its line: `![[photo.png|center|300]]`
- `==text==` is the highlighter, and `> [!note]-` is a closed callout. A closed callout is opened and closed with the arrow at the right end of its title.
Previous: [[04 Properties, Tags and Links]]
Help
Every new account gets these example notes in the AmeNote Manual folder of its vault. Here they can be read as they look or as they are written.