Fix an Obsidian Bases formula that is not working
Start with the symptom: an invalid expression, a missing column, or a valid formula with the wrong result. Each needs a different check.
Find the right starting point
| What you see | First check |
|---|---|
| Formula editor rejects the expression | Paste location and property names |
| The column is absent | Show the formula in Properties |
| A dash or blank instead of progress | Number types and the denominator |
| Zero vanishes | Separate zero from missing data |
| Sorting or totals look wrong | Use a numeric output column |
Work on one known note first. For the examples below, use pages_read: 84 and total_pages: 240; the expected percentage is 35. If that row works, compare the values on a failing row.
Download the diagnostic examples (.zip) ↓
Unzip and open Guide examples as a separate Obsidian vault. Open Diagnostics.base. It contains five deliberately different inputs, plus separate date and filter exercises. All sample notes are fictional; no community plugins are required.
1. Check where you pasted the expression
A formula belongs in Properties → Add formula → Formula inside a base. The field takes the expression itself. Do not include Markdown backticks, an Excel-style leading =, or an entire formulas: YAML section there. A complete .base file has a different job: it stores the view configuration.
Reduce a failing formula to a single reference, such as note["pages_read"]. This should show the source value. If it does not, check the actual property key in the note, including punctuation. A friendly column label is not necessarily its stored key.
Names containing spaces or hyphens
Our sample notes have two additional numeric fields, pages-read: 7 and bonus pages: 3. This expression adds them:
note["pages-read"] + note["bonus pages"]The expected result is 10. The bracketed references keep the whole key together; typing pages-read as arithmetic would not identify that same property. Keep the straight quotation marks from the copied expression.
2. Make the formula column visible
Creating a formula does not guarantee that it is visible in the current view. Close the formula editor, open Properties, and enable the new formula. If you have several views, check the one you are actually looking at.
If there are no rows at all, solve the filter first. Temporarily use the practice vault's unfiltered source notes to compare. The filter guide explains why a current-view rule cannot bring back a file excluded by an all-views rule.
3. Test the input type, not just its appearance
In our diagnostic vault, numeric 84 and text "84" look similar in the source but behave differently. Add this temporary formula:
note["pages_read"].isType("number")It should be true for the Normal and Zero rows, and false for Missing and Text. If your input is text, correct the note property to a Number and inspect the stored value. Removing a unit such as pages is safer than making a formula guess what arbitrary text means.
For the progress generator, both inputs must be numbers and the total must be greater than zero. Its dash is intentional: it does not report an unknown or invalid ratio as 0%. A zero total cannot describe a meaningful completed share. Fix the source total instead of suppressing that warning.
4. Keep a real zero separate from missing data
A check such as if(note["pages_read"], …) asks whether the value is truthy. It does not mean “a number is present.” To keep an unstarted book at zero while marking missing or text values, use:
if(note["pages_read"].isType("number"), note["pages_read"], "Unknown")| Sample input | Result | Meaning in this example |
|---|---|---|
| 84 | 84 | Known count |
| 0 | 0 | Known, not started |
| Property absent | Unknown | No count supplied |
| "84" (text) | Unknown | Wrong input type |
This is a display diagnostic, not a numeric summary column: it can return either a number or the word Unknown. Keep the original input visible while fixing the data.
5. Use numbers for percentage sorting
A bar such as ▰▰▰▰▱▱▱▱▱▱ 35% is text. For sorting by completion, add a separate formula named numeric_progress:
if(note["pages_read"].isType("number") && note["total_pages"].isType("number"), if(note["total_pages"] > 0, (min(1, max(0, note["pages_read"] / note["total_pages"])) * 100).round()))Normal produces 35, Zero produces 0, and missing, text, or zero-total inputs produce no value. Select this formula in Sort to order by the calculated number. The result is on a 0–100 scale; it does not include a percent sign. As with our text bar, inputs below zero or above the total are capped for display and do not change the source notes.
Hide a displayed zero deliberately
If you specifically want the numeric zero to appear blank, add a second formula:
if(formula.numeric_progress != 0, formula.numeric_progress)This references numeric_progress, so create that formula first. It changes what you see; it does not erase the original zero. Do not interpret blank as “unknown” once you have chosen to hide known zeros. We have tested the individual cell outputs here, not every aggregation or summary configuration.
Testing and next steps
On October 31, 2026, we opened the diagnostic vault in Obsidian 1.14.5 on macOS. We checked five rows: normal numbers, numeric zero, a missing count, a text count, and a zero total. The numeric formula returned 35, 0, and blank for the three invalid cases; the optional display formula hid zero. The separate Property names view returned 10 for the two custom keys. Other Obsidian versions and mobile apps have not been tested.
Official references checked October 31, 2026: formula properties, property references and syntax, and type checks and if(). The practice cases and walkthrough are our own.
Once the sample row works, generate a progress bar for your field names, or follow the complete reading tracker setup. See how we test these guides for the limits of this evidence.