Formatting Issues

How to Highlight the Highest Values Within Each Group in Excel

Adam DavisAdam Davis Nov 10, 2026 868 views

Question details

The user needs to identify and highlight the highest allocation proportions within specific categories (courses), including values that fall within a 0.1 difference threshold from the maximum value of that category.

How to Highlight the Highest Values Within Each Group in Excel
Product
Excel
Device & OS
not provided
Scenario
Applying conditional formatting to a dataset to visually flag top-performing records within distinct groups, while allowing a predefined variance threshold (e.g., within 0.1 of the group's maximum).
Observed behavior
The user is unsure how to configure the formatting logic to compare each value against the maximum of its specific group, especially regarding how to handle edge cases where the variance threshold is not met.
Before you start

Ensure your data is organized with clear column headers for categories (like courses) and values. Verify the exact logical threshold you want to apply, as incorrect variance logic will highlight the wrong cells.

Solution 1Recommended

Apply Conditional Formatting Using a Custom Formula

Use a custom formula in Conditional Formatting to dynamically find the maximum value per course and highlight values within your 0.1 threshold.

By combining the MAX and IF functions within a conditional formatting rule, Excel can evaluate each row's value against the maximum value of its specific group.

1
Select the data range

Highlight the range of cells containing the values you want to format (e.g., B2:B100). Ensure the active cell is the top cell of your selection.

2
Open Conditional Formatting

Go to the 'Home' tab on the Excel ribbon, click on 'Conditional Formatting', and select 'New Rule' from the dropdown menu.

3
Enter the custom formula

Choose 'Use a formula to determine which cells to format'. Enter the formula: =B2>=(MAX(IF($A$2:$A$100=A2,$B$2:$B$100))-0.1). This assumes Column A contains the course names and Column B contains the values.

4
Apply the formatting style

Click the 'Format' button, navigate to the 'Fill' tab, choose a highlight color, and click 'OK' twice to apply the rule to your dataset.

Apply Conditional Formatting Using a Custom Formula
Absolute vs. Relative References: Pay close attention to the dollar signs ($) in the formula. The ranges ($A$2:$A$100) must be absolute, while the criteria cell (A2) must be relative so it updates for each row.
Master Data Formatting with WPS Spreadsheet

Easily Highlight Conditional Data with WPS Office

WPS Spreadsheet provides a powerful, user-friendly interface for applying complex conditional formatting rules. You can easily highlight top values within groups using built-in features and full support for advanced formulas.

  1. 1. Open your file: Launch WPS Office and open your spreadsheet containing the categorized data.
  2. 2. Select the data: Highlight the column or specific cells where you want the formatting to appear.
  3. 3. Access Conditional Formatting: Navigate to the 'Home' tab and click on the 'Conditional Formatting' icon.
  4. 4. Create a New Rule: Select 'New Rule', choose the formula option, and input your threshold formula to instantly highlight your data.
Fully compatible with Microsoft Excel formats (.xlsx) and conditional formatting rules.Lightweight and runs smoothly even when processing large datasets with complex array formulas.Free to use with a familiar tabbed interface, ensuring a zero-learning-curve migration.Built-in advanced conditional formatting manager makes it easy to edit and troubleshoot rules.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my conditional formatting formula highlighting the wrong cells?

This usually happens due to incorrect cell referencing. Ensure your formula uses absolute references for the lookup ranges (e.g., $A$2:$A$100) and relative references for the current row's criteria (e.g., A2). Also, ensure the active cell when creating the rule matches the relative reference in your formula.

Can I highlight the top 3 values in each group instead of using a difference threshold?

Yes, but it requires a different formula using the LARGE function combined with an IF array. You would use a formula like =B2>=LARGE(IF($A$2:$A$100=A2,$B$2:$B$100),3) in your conditional formatting rule.

How do I change or remove the highlight color later?

Go to the Home tab, click Conditional Formatting, and select 'Manage Rules'. Choose 'This Worksheet' from the dropdown at the top, select your rule, and click 'Edit Rule' to change the color, or 'Delete Rule' to remove it entirely.