# Ranking

One common use of conditional formatting is to highlight the top/bottom N ranked items in a report, which can help to quickly identify the most important or relevant items in the data.

Refer to the [Create Rule](https://docs.inforiver.com/working-with-inforiver/5.-conditional-formatting/create-rule-reporting-matrix) section to get started. Once the rule is created and you can see the Conditional Formatting side panel, follow the steps below.

Select 'Ranking' in the **Format by** dropdown. [Learn more about using the Style section to apply formatting](https://docs.inforiver.com/working-with-inforiver/5.-conditional-formatting/rules-if-conditions#style).

* Let's apply icon-based formatting to the Top 2 subcategories based on Consumer > Sales.&#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FdvBiqZwDREOY683vNZlx%2Fimage.png?alt=media&#x26;token=1cb85e5d-bb95-4e33-a150-c29d5a6312c5" alt=""><figcaption><p>Conditional formatting based on ranking</p></figcaption></figure>

* You can also apply ranking based on percentages. In the sample report, the top 30% of subcategories based on Total Q2 sales are highlighted.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FfTuZP4x8bGdNBcYVYlng%2Fimage.png?alt=media&#x26;token=010ad7cf-5603-48fd-aa44-fdbbd854d590" alt=""><figcaption><p>Conditional formatting based on percentages</p></figcaption></figure>

* You can apply conditional formatting for the top and bottom items using the 'Both' option. In the sample report, conditional formatting has been applied based on the top and bottom subcategories.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FOAmj60on4H0TuSMpG9Vk%2Fimage.png?alt=media&#x26;token=51235923-44bb-4274-b0fe-bf75d1e71c4c" alt=""><figcaption><p>Conditional formatting for top and bottom sub categories</p></figcaption></figure>

* Let's create a rule for highlighting the top 2 categories. When you click Apply, conditional formatting doesn't work. This is because the category dimension is at a total level, but we have defined **Row hierarchy levels** as 'Values only'.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FAsqhIVELTCogRDJtnbX2%2Fimage.png?alt=media&#x26;token=a97b669e-88c2-493a-8af3-2d643db867f3" alt=""><figcaption><p>Conditional formatting for totals</p></figcaption></figure>

Change the **Row hierarchy levels** to 'Values and totals' and click Apply. 'Office Supplies' and 'Technology' are highlighted now.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FaOgY2cfgD92U09A7odF4%2Fimage.png?alt=media&#x26;token=57e4571e-e625-47a3-8c90-b4c7949b22e6" alt=""><figcaption></figcaption></figure>
