cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

Docs: stills of tracing, evaluate, tables, rules and borders

Dami committed 405058c
Tracing and tables show 012's screen as pictures instead of text in code
blocks. Rules reads as docs for a reader: what rules are and a picture,
the panel and how to add and change one, then reference tables of kinds
and conditions. Borders say how to draw them beside a picture instead
of spelling out the glyphs.
commit
405058c18bfee2db72794869f921a6babe779b2b
parent
f5693f2341f4aca25d730e3ffa612f3cf1b08a7a
author
Dami <dami.etoile@gmail.com>
kind
docs risk score 0.0 of 3, Jev's estimate
4 files changed, +154 -129
Mdocs/formulas/tracing.md17+--
Mdocs/sheets/formatting.md51++++----
Mdocs/sheets/rules.md197+++++++++++++++++-------------
Mdocs/sheets/tables.md18+--
M docs/formulas/tracing.md +6 -11
@@ -18,11 +18,11 @@ the pointer moves: the cells the active cell's formula reads in green,
1818 the formulas that read the active cell in magenta and bold. Without1919 color both are in reverse video, dependents bold as well. The context2020 line lists them all, those off screen with an arrow toward them and21-those on other sheets with their sheet:21+those on other sheets with their sheet (`C7 reads B3, Rate, Data!B2:B9;22+read by D7, A40↓, Summary!B2 +3 more`):2223 23-```24-C7 reads B3, Rate, Data!B2:B9; read by D7, A40↓, Summary!B2 +3 more25-```24+![Tracing on at the total in B7: B3:B5, which it reads, marked green, C7, which reads it, magenta, and the context line listing them, B30 below the screen](../media/trace-view-dark.png#gh-dark-mode-only)25+![Tracing on at the total in B7: B3:B5, which it reads, marked green, C7, which reads it, magenta, and the context line listing them, B30 below the screen](../media/trace-view-light.png#gh-light-mode-only)2626 2727 Alt+; again stops. What counts as a link:2828
@@ -64,13 +64,8 @@ Evaluate Formula, opens a box over the grid with the active cell's
6464 formula. The part computed next is underlined, and the line under it6565 says what it computes:6666 67-```68-┌─ Evaluate D1 ────────────────────────────────────────┐69-│ =IF(TRUE,SUM(A2:A3)*2,A3) │70-├──────────────────────────────────────────────────────┤71-│ Next SUM(A2:A3) = 5 │72-└───────────────────────────────────────────── 2 of 5 ─┘73-```67+![Evaluate formula on B8, two steps in: the values computed so far in italic, the next part underlined, and on the line under it what that part computes](../media/evaluate-dark.png#gh-dark-mode-only)68+![Evaluate formula on B8, two steps in: the values computed so far in italic, the next part underlined, and on the line under it what that part computes](../media/evaluate-light.png#gh-light-mode-only)7469 7570 - Enter puts the value in its place, in italic, and underlines the next7671 part, until the formula's value is all that's left; Enter then starts
M docs/sheets/formatting.md +28 -23
@@ -97,31 +97,36 @@ copied, cut or moved.
9797 9898 ## Borders9999 100-Format > Borders draws lines along the edges of the selected cells: all101-of them, the outline (outer), the lines between the cells (inner), or102-one side; None removes them. Lines are thin, thick or double, whichever103-of Thin lines, Thick lines and Double lines was picked last (thin at104-first), as Sheets' border style keeps its choice. Alt+Shift+1 to 4 draw105-the top, right, bottom and left border, Alt+Shift+7 the outline and106-Alt+Shift+6 clears them ([keys](../reference/keys.md#formatting)).100+![A trip plan with thin lines between its cells, a thick outline and a double line under the headers, under a title merged across it; the notes wrap, and their rows grow to fit](../media/layout-dark.png#gh-dark-mode-only)101+![A trip plan with thin lines between its cells, a thick outline and a double line under the headers, under a title merged across it; the notes wrap, and their rows grow to fit](../media/layout-light.png#gh-light-mode-only)102+103+Select the cells, then Format > Borders:104+105+- **All**, **Outer** (the outline) or **Inner** (the lines between the106+ cells) draws those edges; **Top**, **Bottom**, **Left** and **Right**107+ one side; **None** removes them.108+- **Thin lines**, **Thick lines** and **Double lines** pick the line the109+ next border is drawn with, thin until you pick, as Sheets' border110+ style keeps its choice.111+- Alt+Shift+1 to 4 draw the top, right, bottom and left border,112+ Alt+Shift+7 the outline and Alt+Shift+6 clears them113+ ([keys](../reference/keys.md#formatting)).114+115+Where two cells share an edge, the heavier line shows, and drawing an116+edge again from one side replaces the other side's line. Borders are117+part of a cell's formatting: they fall back on rows and columns, travel118+with copies and go with Clear formatting. The outline of whole columns119+or rows runs along the sheet's own edges too: over row 1 and under the120+last row, or down column A and the last column.107121 108122 The grid draws borders with box-drawing characters, which terminals109-join where lines meet (`┌─┬─┐`, `╔═╤═╗`). A line down the side of a cell110-takes the first column of the cell to its right, which is padding111-anyway. A terminal has no thinner line between two rows of characters,112-so a line along the top of a row takes a line of the screen above it,113-as tables printed in a terminal do: a bordered table is taller than a114-plain one. Where two cells share an edge, the heavier line shows, and115-drawing an edge again from one side replaces the other side's line.116-Borders are part of a cell's formatting: they fall back on rows and117-columns, travel with copies and go with Clear formatting. The outline118-of whole columns or rows runs along the sheet's own edges too: over119-row 1 and under the last row, or down column A and the last column.120-121-Unicode has no joint where a double line meets a thick one, so there122-the joint is drawn thick, the heavier look, and the double line starts123-beside it with a thick stub: a double line under the headers of a124-table with a thick outline reads `┣━═══════╪═══════━┫`.123+join where lines meet. A line down the side of a cell takes the first124+column of the cell to its right, which is padding anyway. A terminal125+has no thinner line between two rows of characters, so a line along126+the top of a row takes a line of the screen above it, as tables printed127+in a terminal do: a bordered table is taller than a plain one. Unicode128+has no joint where a double line meets a thick one, so there the joint129+is drawn thick, and the double line starts beside it.125130 126131 ### Border colors127132
M docs/sheets/rules.md +114 -83
@@ -5,95 +5,137 @@ sidebar_position: 7
55 66 # Conditional formatting and data validation77 8+Rules make cells show and check what they hold, as Sheets' do.9+Conditional formatting colors a cell by its value, or draws a bar or an10+icon in it; data validation limits what a cell takes, and gives it a11+dropdown or a checkbox. Both only change how cells look and what they12+accept, never a value already there.13+14+![A class's scores: data bars across the points, arrows by the change and filling circles by grade; a dropdown on each track, and checkboxes for who passed](../media/rules-bars-dark.png#gh-dark-mode-only)15+![A class's scores: data bars across the points, arrows by the change and filling circles by grade; a dropdown on each track, and checkboxes for who passed](../media/rules-bars-light.png#gh-light-mode-only)16+817 ## Conditional formatting918 10-Format > Conditional formatting opens the sheet's rules in a panel at the11-right of the grid, as Sheets' sidebar: `+ Add rule` adds one over the12-selection, Enter edits the highlighted rule, Del removes it and13-Shift+Up/Down moves it. In a rule's form, Up/Down pick a line,14-Left/Right change a choice, Space flips a check, text lines are typed15-into, Enter saves and Esc goes back without saving. Every change is an16-undo step.19+Select the cells, then Format > Conditional formatting. The sheet's20+rules open in a panel at the right of the grid, as Sheets' sidebar:1721 18-![Checking a task off, picking an owner from a dropdown, a rejected entry, and the rules panel](../media/rules.gif)22+![The conditional format rules panel beside a task list: a custom formula striking out done tasks, a color scale on the hours, and a rule on the total, each with a swatch of what it does](../media/rules-panel-dark.png#gh-dark-mode-only)23+![The conditional format rules panel beside a task list: a custom formula striking out done tasks, a color scale on the hours, and a rule on the total, each with a swatch of what it does](../media/rules-panel-light.png#gh-light-mode-only)1924 20-A rule applies to ranges (`A2:A100`, or several: `A2:A9,C2:C9`) and is21-one of:22-23-- **Single color**: cells that meet a condition get a text color, a fill,24- and bold, italic, underline or strikethrough. The conditions are25- Sheets': is empty, is not empty, text contains, does not contain,26- starts with, ends with, is exactly (ignoring case), date is, is before,27- is after, greater than, greater than or equal to, less than, less than28- or equal to, is equal to, is not equal to, is between, is not between,29- and custom formula is; and Excel's, which compare a cell with the rest30- of the rule's cells: top values and bottom values (the highest or31- lowest 1 to 1000, ties included), top and bottom percent, above and32- below average, and duplicate and unique values (text ignoring case).33- A value may be a formula (`=B2`), and a custom formula (`=$C2>100`) is34- written for the first cell of the first range: its relative references35- move with each cell, as a copied formula's would.36-- **Color scale**: every number in the ranges is shaded along two or three37- colors, from its minimum to its maximum; each point is the minimum or38- maximum value, a number, a percent of the way between them, or a39- percentile, and a midpoint is optional.40-- **Data bar**: every number gets a bar across its cell, as long as the41- number is far from the shortest point to the longest. Automatic points42- run from zero (or the lowest number, when that's below zero) to the43- highest; either may be a number, a percent or a percentile. Bars are44- drawn in eighth blocks (`██▍`) in one of the named colors, so a bar45- ends within a column, and text they run under is drawn in reverse46- video; Show bar only hides the numbers.47-- **Icon set**: every number gets an icon at its cell's left by the48- thresholds it reaches, each a percent of the way from lowest to49- highest, a number or a percentile: arrows (`↓ → ↑`, in 3, 4 or 5),50- circles filling up (`○ ◑ ●`, in 3, 4 or 5), symbols (`✗ ! ✓`) or51- rating bars (`▂ ▄ ▆ █`, in 4 or 5), the lowest red, the highest green52- and those between yellow (rating bars blue). Reverse icons gives the53- lowest values the highest icon, and Show icon only hides the numbers.54-55-Dates in "date is", "is before" and "is after" are a date, or a period56-as Sheets and Excel name them: today, tomorrow, yesterday, the past57-week, month or year, and this, last or next week, month or year (weeks58-run Sunday to Saturday). A date is in a period, before its first day or59-after its last.60-61-Data bars and icons are glyphs, so they read without color as they do62-in it; their colors are the terminal's, as the other rules' are.25+- **Add a rule**: `+ Add rule` makes one over the selection and opens26+ its form. Up and Down pick a line, Left and Right change a choice,27+ Space flips a check, text lines are typed into; Enter saves and Esc28+ goes back without saving.29+- **Change one**: Enter edits the highlighted rule, Del removes it, and30+ Shift+Up and Shift+Down move it up or down the list.31+- **Take cells out of every rule**: Format > Clear conditional formats32+ on the selection.33+34+Every change is an undo step. A rule applies to ranges (`A2:A100`, or35+several: `A2:A9,C2:C9`), and is one of four kinds:36+37+| Rule | Does | Shows |38+|---|---|---|39+| Single color | Formats the cells that meet a [condition](#conditions) | A text color, a fill, and bold, italic, underline or strikethrough |40+| Color scale | Shades every number from its [lowest point to its highest](#points) | A fill along two or three colors |41+| Data bar | Draws a bar across every number, as long as the number is far from the shortest point to the longest | A bar in one of the named colors; the text over it in reverse video. Show bar only hides the numbers |42+| Icon set | Puts an icon at the left of every number by the thresholds it reaches | Arrows (3, 4 or 5), circles filling up (3, 4 or 5), symbols (3) or rating bars (4 or 5), the lowest red, the highest green, those between yellow (rating bars blue). Reverse icons turns them around; Show icon only hides the numbers |43+44+Data bars and icons are characters (eighth blocks, arrows, circles), so45+they read without color as they do in it.46+47+### Conditions48+49+A single-color rule formats the cells that meet its condition; a value50+in it may be a formula (`=B2`).51+52+| Condition | A cell meets it when |53+|---|---|54+| Is empty, is not empty | It's blank, or not |55+| Text contains, does not contain, starts with, ends with, is exactly | Its text does, ignoring case |56+| Date is, is before, is after | Its date is, is before or is after a date or a [period](#dates-and-periods) |57+| Greater than, greater than or equal to, less than, less than or equal to, is equal to, is not equal to, is between, is not between | Its number compares so |58+| Custom formula is | The formula is TRUE for it |59+| Top values, bottom values | It's among the highest or lowest 1 to 1000 of the rule's cells, ties included |60+| Top percent, bottom percent | It's in the highest or lowest percent of them |61+| Above average, below average | It's above or below their average |62+| Duplicate values, unique values | Another of them holds the same (text ignoring case), or none does |63+64+The last four are Excel's and compare a cell with the rest of the65+rule's cells; the others are Sheets'. A custom formula (`=$C2>100`) is66+written for the first cell of the first range: its relative references67+move with each cell, as a copied formula's would.68+69+#### Dates and periods70+71+A date condition takes a date, or a period as Sheets and Excel name72+them: today, tomorrow, yesterday, the past week, month or year, and73+this, last or next week, month or year (weeks run Sunday to Saturday). A74+date is in a period, before its first day or after its last.75+76+### Points77+78+A color scale runs from a minimum to a maximum, with an optional79+midpoint, and a data bar from its shortest point to its longest. Each80+point is the lowest or highest value, a number, a percent of the way81+between them, or a percentile. A data bar's automatic points run from82+zero (or the lowest number, when that's below zero) to the highest. An83+icon set's thresholds are each a percent of the way from lowest to84+highest, a number or a percentile.85+86+### Which rule wins, and colors6387 6488 Rules are tried in order, and the first that applies to a cell formats65-it, so a rule higher in the list wins. The pointer and the selection draw66-over a rule's colors; its text styles show through them.89+it, so a rule higher in the list wins. The pointer and the selection90+draw over a rule's colors; its text styles show through them.6791 6892 Colors are named (red, yellow, green, cyan, blue, magenta) rather than6993 picked from a color wheel, because each is one of the terminal's 16 ANSI70-colors: the terminal's palette or the color scheme ([Themes](../terminal/themes.md))71-decides what they look like, and a fill's text is drawn in whichever of72-black or white reads on it. A text color that wouldn't read on a rule's73-fill takes the fill's ink instead. Color scales blend the scheme's colors74-(or the terminal's, as it reports them) and pick readable text for each75-shade.94+colors: the terminal's palette or the color scheme95+([Themes](../terminal/themes.md)) decides what they look like, and a96+fill's text is drawn in whichever of black or white reads on it. A text97+color that wouldn't read on a rule's fill takes the fill's ink instead.98+Color scales blend the scheme's colors (or the terminal's, as it reports99+them) and pick readable text for each shade.76100 77101 Rules only change how cells look, so they may go on a pivot table's78102 results. They follow inserted and deleted rows and columns, and a rule79-whose cells are all deleted goes. Format > Clear conditional formats80-takes the selection out of every rule.103+whose cells are all deleted goes.81104 82105 ## Data validation83106 84-Data > Data validation opens the sheet's validation rules in the same85-panel; Insert > Dropdown opens it with a dropdown for the selection, and86-Insert > Checkbox makes the selection checkboxes at once. The criteria:107+Select the cells, then Data > Data validation: the sheet's validation108+rules open in the same panel, and work as conditional formats' do.109+Insert > Dropdown opens it with a dropdown for the selection, and110+Insert > Checkbox makes the selection checkboxes at once.111+112+![Checking a task off, picking an owner from a dropdown, a rejected entry, and the rules panel](../media/rules.gif)87113 88114 | Criteria | Cells may hold | Shows |89115 |---|---|---|90-| Dropdown | one of the items typed (`Yes, No, Maybe`), ignoring case | the value on a chip, `▐Yes ▾▌`, or ▾ at the right of the cell |91-| Dropdown (from a range) | one of the values in a range, on any sheet (`Lists!A1:A20`) | a chip, or ▾ |116+| Dropdown | One of the items typed (`Yes, No, Maybe`), ignoring case | The value on a chip, or ▾ at the right of the cell |117+| Dropdown (from a range) | One of the values in a range, on any sheet (`Lists!A1:A20`) | A chip, or ▾ |92118 | Checkbox | TRUE or FALSE, or values of its own (`Yes` and `No`); a blank cell is unchecked | `[✓]` or `[ ]`, centered |93-| Number | a number between, not between, equal to, greater than ... values | |94-| Date | any date, or one on, after, before, between ... dates | |95-| Text length | text whose length is between, less than ... | |96-| Custom formula is | anything for which the formula (`=B2<=C2`) is TRUE | |119+| Number | A number between, not between, equal to, greater than ... values | |120+| Date | Any date, or one on, after, before, between ... dates | |121+| Text length | Text whose length is between, less than ... | |122+| Custom formula is | Anything for which the formula (`=B2<=C2`) is TRUE | |123+124+Blanks are always valid, and a formula is checked by the value it125+computes. Each cell has one rule: a rule added over cells that had126+another takes them from it. Validation can't go on a pivot table's127+results, which take no entries. Data > Remove data validation takes the128+selection out of every rule.129+130+### Dropdowns and checkboxes131+132+- **Pick an item**: Alt+Down, or a click on the ▾, opens a dropdown's133+ list under the cell; type to search, and Enter enters the item as if134+ typed. When the active cell has no dropdown, Alt+Down opens the135+ column's filter.136+- **Check a box**: Space, or a click on the box, checks or unchecks the137+ selected checkboxes (all checked when the active one isn't, as in138+ Sheets); Space anywhere else starts an entry as usual.97139 98140 A dropdown's Display is Sheets' too: Chip draws its value between99141 rounded ends in reverse video, with the ▾ inside (new dropdowns), Arrow
@@ -102,12 +144,7 @@ Checked and Unchecked values, when set, are what checking and
102144 unchecking enter instead of TRUE and FALSE; with only a checked value,103145 unchecking leaves the cell blank.104146 105-Alt+Down, or a click on the ▾, opens a dropdown's list under the cell:106-type to search, Enter enters the item as if typed. Space, or a click on107-the box, checks or unchecks the selected checkboxes (all checked when108-the active one isn't, as in Sheets); Space anywhere else starts an entry109-as usual. When the active cell has no dropdown, Alt+Down opens the110-column's filter.147+### Rejected or warned111148 112149 Each rule either **rejects** an invalid entry or **shows a warning**.113150 Rejected, the entry stays open with Sheets' message on the context line
@@ -115,13 +152,7 @@ Rejected, the entry stays open with Sheets' message on the context line
115152 fixing or Esc. Warned, it goes in, and the cell's text gets a dotted116153 underline; on the active cell the context line says why ("Invalid:117154 Input must be ..."). A rule's help text, when it has one, replaces its118-own words there. A formula is checked by the value it computes. Blanks119-are always valid.120-121-Each cell has one rule: a rule added over cells that had another takes122-them from it. Validation can't go on a pivot table's results, which take123-no entries. Data > Remove data validation takes the selection out of124-every rule.155+own words there.125156 126157 What validation checks:127158
M docs/sheets/tables.md +6 -12
@@ -10,6 +10,9 @@ Sheets' and Excel's tables. Formulas read it by those names,
1010 `=SUM(Sales[Amount])`, so they keep reading the right cells as the table1111 grows and its columns move ([Structured references](../formulas/references.md#tables-by-column-name)).1212 13+![The table Sales, its header styled and its rows banded, the pointer on its Amount column; the context line says how formulas read the column, and the total beside the table sums it](../media/table-dark.png#gh-dark-mode-only)14+![The table Sales, its header styled and its rows banded, the pointer on its Amount column; the context line says how formulas read the column, and the total beside the table sums it](../media/table-light.png#gh-light-mode-only)15+1316 ## Making one1417 1518 Format > Convert to table (Ctrl+Alt+T) makes a table of the selection, or
@@ -25,18 +28,9 @@ A blank header is named after its place (`Column3`) and a repeat
2528 numbered (`Amount2`), in the cell too, so the header shows what formulas2629 use. A selection of one row gains an empty row of data below it.2730 28-```29- A B C30- 1 Region Units Amount31- 2 North 2 1032- 3 South 3 2033- 4 East 5 3034-```35-36-Made a table named `Sales`, this reads `Sales[Amount]` as C2:C4 and37-`Sales[#All]` as A1:C4; a value typed in row 5 joins it.38-39-On a table's cell the context line names the table and the column, and31+The table above is A1:D7, named `Sales`: `Sales[Amount]` reads D2:D732+and `Sales[#All]` reads A1:D7, and a value typed in row 8 joins it. On33+a table's cell the context line names the table and the column, and4034 how a formula reads it: `Table Sales, column Amount: Sales[Amount] in4135 formulas`.4236