# Formula Validation Errors

{% stepper %}
{% step %}

### Types of validation checks

The Formula editor validates:

* **Syntax**
  * Only supported operators are used.
  * Parentheses are balanced.
* **References**
  * All referenced variables and drivers exist.
  * There are no unknown names.
* **Structural issues**
  * The formula does not contain unsupported constructs such as IF statements or cell references.

If any check fails, the formula is marked invalid.
{% endstep %}

{% step %}

### How errors are displayed

When there is a problem, the editor may:

* Highlight the problem area in the expression.
* Show an error message in the diagnostics or preview section.
* Disable the Save button until the error is resolved.

The error message will usually indicate the general cause, such as "Unknown reference" or "Unsupported operator".
{% endstep %}

{% step %}

### Common error causes

Common causes include:

* Typing an unsupported function such as `IF`, `SUM` or `MAX`.
* Misspelling a variable or driver name instead of selecting it from the sidebar or autocomplete.
* Leaving parentheses unmatched.
* Using a character that is not allowed in expressions.

Checking the message and reviewing the expression usually reveals the issue quickly.
{% endstep %}

{% step %}

### Fixing invalid formulas

To fix an invalid formula:

* Read the error message to understand the type of issue.
* Correct the expression, for example by selecting the correct reference from the sidebar.
* Confirm that the error message disappears and the preview updates.
* Save once the formula is valid.

You cannot save an invalid formula, so no broken formulas are stored in the model.
{% endstep %}

{% step %}

### Safe editing practices

To reduce formula errors:

* Prefer clicking variables and drivers from the sidebar instead of typing full names.
* Keep formulas relatively short and use drivers or intermediate variables for complex logic.
* Test changes incrementally, watching the preview as you go.

This keeps your formula layer maintainable and easier to review.
{% endstep %}
{% endstepper %}

## Related articles

* [Scenario Toggle Rules](/syntax/chart-and-table-syntax/scenario-toggle-rules.md)
* [Start & End Dates](/syntax/timing-syntax/start-and-end-dates.md)
* [COA Import](/help/xero-integration/coa-import.md)
* [Build an Acquisition Case vs Base Case](/how-tos/investment-and-transactions/build-an-acquisition-case-vs-base-case.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.modelreef.io/syntax/formula-syntax/formula-validation-errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
