> For the complete documentation index, see [llms.txt](https://docs.phocassoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phocassoftware.com/flex-modes/customize-the-grid/apply-conditional-formatting.md).

# Apply conditional formatting

Use conditional formatting to quickly highlight specific values in the grid.

{% hint style="info" %}
User permission: **Query**
{% endhint %}

Apply formatting rules to change the text or background color of cells based on values. This formatting makes it easier to interpret the data visually and lets you spot trends and anomalies without needing to filter or sort. It's particularly useful in grids that contain a lot of data, where key insights can be easily lost.

{% embed url="<https://phocassoftware.wistia.com/medias/906bsr27yz>" %}
Apply conditional formatting
{% endembed %}

You can define different formatting rules for the grid, matrix, and transactions views, giving you the flexibility to create separate visual cues that suit each one. All your rules are included when you save a favorite, making it easy to retain your personalized formatting for future analysis.

When you [export](/flex-modes/save-and-share-your-work/copy-or-export-data.md) the data to Excel, your conditional formatting is applied, ensuring consistency between what you see in the grid and in the Excel output. The rules are generated automatically with static values, so while you can view the formatting, you can’t modify the rules directly in Excel.

## Remove default highlighting

By default, cells with zero values or no data are highlighted in light blue.

To remove this highlighting, open the **Conditional formatting** panel and clear **Highlight zero and empty cells**. Select it again to restore the highlighting.

<figure><img src="https://2122657374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGOWDU4SqRSiSPGXHgW%2Fuploads%2F2MZi3jadbYGjctZwIsAU%2Fimage.png?alt=media&amp;token=b5f00406-a644-4bcd-9d58-a12c1c0daebc" alt=""><figcaption></figcaption></figure>

## Add rules <a href="#add-rules" id="add-rules"></a>

1. Click the **Conditional formatting** <img src="https://content.gitbook.com/content/aDGOWDU4SqRSiSPGXHgW/blobs/FOpAN2uPaQTzne74lTGY/conditional-formatting.png" alt="" data-size="line"> button in the top-right toolbar above the grid.
2. In the **Conditional formatting** panel, click **Add rule**.
3. Select the column(s) to which you want to apply the formatting.
4. Select the condition, then configure it as required.
5. Select the text and background colors applied when the condition is met.
6. Click **Apply**. The new formatting is applied to the grid.
7. Review the formatting in the grid to ensure it looks as expected.
8. Repeat the above steps to add more rules. When you finish setting up the conditional formatting, click **Close**. You can reopen this panel at any time to make changes.
9. [Save your view as a favorite](/flex-modes/save-and-share-your-work/save-and-share-favorites.md) to retain the formatting for next time.

{% hint style="warning" %}

* If you change your view of the grid, some formatting might not make sense. For example, if you apply rules to the Total column when the Sales Rep dimension is selected, then click the Product dimension, the formatting might not make sense because the total values are different.
* Rules are applied from top to bottom. In the event of a conflict, the bottom rule overwrites the rule above it.
  {% endhint %}

### Examples: Highlight sales rep performance

Use conditional formatting to apply a traffic light color scheme, highlighting sales values against set thresholds or identifying your top and bottom performers.

#### A. Highlight sales against a target

Suppose you want to quickly see if your Sales Reps are meeting the sales target.

This example uses Variance mode to compare the current month's sales with the previous month.

1. In the **Conditional formatting** panel, add a rule, then:
   1. Select **The whole grid** under Columns.
   2. Select the **Greater than** condition and enter **100000**.
   3. Choose green text formatting.
2. Add another rule:
   1. Select **The whole grid** under Columns.
   2. Select the **Less than** condition and enter **80000**.
   3. Choose red text formatting.
3. Click **Apply**.

The results highlight sales values above 100,000 in green and below 80,000 in red. Values between these thresholds remain unchanged.

<figure><img src="https://2122657374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGOWDU4SqRSiSPGXHgW%2Fuploads%2F5a3L6HRzLNUmjl91ori0%2Fimage.png?alt=media&amp;token=e4a7a748-dd1f-4374-965b-d124b3b3afd8" alt=""><figcaption></figcaption></figure>

#### B. Identify top and bottom performers

Suppose you want to quickly identify your highest and lowest performing sales reps against the budget.

This example uses Stream mode with the Budget stream as the variance. It reviews the previous month's data.

1. In the **Conditional formatting** panel, add a rule, then:
   1. Select the **Budget** column.
   2. Select the **Top** condition, enter **20**, and select **Percent**.
   3. Choose yellow formatting.
2. Add another rule:
   1. Select the **Budget** column.
   2. Select the **Bottom** condition, enter **10**, and select **Percent**.
   3. Choose red formatting.
3. Add another rule:
   1. Select the **Budget** column.
   2. Select the **Top** condition, enter **10**, and select **Percent**.
   3. Choose green formatting.
4. Click **Apply**.

The results highlight the top 10% of performers in green, the next 10% in yellow, and the bottom 10% in red.

<figure><img src="https://2122657374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGOWDU4SqRSiSPGXHgW%2Fuploads%2FMiAbku3sdVRflJGXraSI%2Fimage.png?alt=media&amp;token=b8473e5e-ffc4-4434-b848-fd030f66dfcf" alt=""><figcaption></figcaption></figure>

## Edit a rule

Click the **Conditional formatting** button to open the panel and view the existing rules. Make your changes, then click **Apply**.

## Delete a rule

Click the **X** button at the top right of the rule card, then click **Apply**.


---

# 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.phocassoftware.com/flex-modes/customize-the-grid/apply-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.
