> For the complete documentation index, see [llms.txt](https://docs.trymito.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trymito.io/how-to/formatting/conditional-formatting.md).

# Conditional Formatting

Explore or highlight your data by changing the format of specific cells.

{% hint style="info" %} <img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2F33pbsEsNWz43XeXK61bR%2Fspaces--MP_U5ZCmiamDOXEOOTC-uploads-git-blob-f8b7f9b98651f829f5edc50dd64de70268a8d9b0-Pro%20Logo(1).png?alt=media&amp;token=b117f44a-b417-400c-af59-f9f03cc3c550" alt="" data-size="line"> This is a [Mito Pro](https://www.trymito.io/plans) feature. [Upgrade](https://www.trymito.io/plans) to highlight important data with ease. <img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2F33pbsEsNWz43XeXK61bR%2Fspaces--MP_U5ZCmiamDOXEOOTC-uploads-git-blob-f8b7f9b98651f829f5edc50dd64de70268a8d9b0-Pro%20Logo(1).png?alt=media&amp;token=b117f44a-b417-400c-af59-f9f03cc3c550" alt="" data-size="line">&#x20;
{% endhint %}

Conditional formatting makes it easy to highlight certain values or make particular cells easy to identify. It changes the appearance of a cell based on a condition. You can use conditional formatting to highlight cells that contain values which meet a certain condition.

### Adding Conditional Formats

1. Open the **Home** tab of the toolbar.
2. Click **Conditional Formatting** in the toolbar.
3. Click **Add Conditional Formatting Rule.**&#x20;
4. Click on the newly added rule to configure it:
   1. Select the **Columns** to apply the conditional format within.
   2. Select the filter condition **Where** the conditional format should apply.
   3. Set the **Text Color** and **Background Color** to apply to the cells identified by this condition.

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FPJidRvYGq1a275sstwn6%2FScreen%20Shot%202022-09-28%20at%2010.47.45%20AM.png?alt=media&amp;token=815834b6-b3a9-48a6-9ba5-f769de4d28af" alt=""><figcaption><p>A conditional format being applied to the column X to highlight values over 7.</p></figcaption></figure>

#### Adding Multiple Conditional Formats

Conditional formatting rules will be applied in-order, with later conditional formatting rules overwriting earlier ones. For example:

1. First conditional format sets cells >= 7 to have a red background color.
2. Second conditional format sets cells >= 8 to have a blue background color.

All cells equal to 7 will have a red background. All cells >= 8 will have a blue background color, as this rule is later, and so will overwrite the first conditional format.

#### Invalid Conditional Formatting Rules

Not all conditions can be applied to all columns. For example, if you are adding a conditional format to a number column, but you use the **string starts with** condition to select cells, this will error.

If the conditional formatting rule cannot be applied, it will display an error message prompting you to update the filter condition.&#x20;

### The Generated Styling Code

To view the dataframe with conditional formats in your notebook, simply display the styling object generated by Mito:

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FZFS5Lf1nX3rETlWHT08z%2FScreen%20Shot%202022-09-28%20at%2010.53.29%20AM.png?alt=media&amp;token=899c89ce-7db7-4bda-b050-7331b0c2ed87" alt=""><figcaption><p>The styling code generated by Mito, plus a line of code that displays the styled object.</p></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trymito.io/how-to/formatting/conditional-formatting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
