> For the complete documentation index, see [llms.txt](https://help.modelreef.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.modelreef.io/syntax/formula-syntax/selecting-variables-in-sidebar.md).

# Selecting Variables in Sidebar

{% hint style="info" %}
The sidebar is the easiest and safest way to reference variables in expressions.
{% endhint %}

This article explains how to select variables from the Formula editor sidebar in Model Reef.

You will learn:

* How variables are listed and grouped in the sidebar.
* How to insert variable references into formulas safely.
* How renaming variables interacts with formulas.

{% stepper %}
{% step %}

### Variable listing in the sidebar

In the Formula editor sidebar, variables are usually:

* Grouped by branch, category or another logical scheme.
* Listed alphabetically within each group.
* Shown with both name and sometimes type, to help identification.

Only variables available in the current model and scenario are shown.
{% endstep %}

{% step %}

### Inserting a variable into a formula

To insert a variable reference:

* Open the Formula editor.
* Locate the variable in the sidebar group.
* Click the variable name.

The reference is inserted into the expression area at the cursor position using the correct internal identifier. This avoids typos and broken links.
{% endstep %}

{% step %}

### Searching for variables

If the sidebar supports search:

* Start typing part of the variable name in the search box.
* The list filters to matching variables.
* Click to insert once you find the right one.

Consistent naming makes search more effective in large models.
{% endstep %}

{% step %}

### Behaviour when variables are renamed

Formulas refer to variables by internal identifiers, not by display names:

* When you rename a variable, any formulas that reference it continue to work.
* The Formula editor updates the display name in references automatically.

This lets you improve naming over time without breaking formulas.
{% endstep %}

{% step %}

### Avoiding hard coding

Using the sidebar to reference variables is preferable to hard coding numbers because:

* It keeps logic centralised.
* Changes to a variable's time series automatically flow into dependent formulas.
* Reviewers can trace how values are built up by following variable references.

Whenever possible, use variable references instead of static constants for key relationships.
{% endstep %}
{% endstepper %}

## Related articles

* [Variables Syntax](/syntax/variables-syntax.md)
* [Period Selector](/syntax/understanding-the-interface/period-selector.md)
* [Dividend Variables: what is, rules, what it affects](/help/drivers-variables-and-timing/dividend-variables.md)
* [Build a Valuation Sensitivity Model](/how-tos/valuation/build-a-valuation-sensitivity-model.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/selecting-variables-in-sidebar.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.
