Don’t feel like reading? Watch the video tutorial:
When working with data in Google Sheets, you sometimes need to highlight the highest value (maximum) or the lowest value (minimum) in a dataset at a glance. Conditional Formatting in Google Sheets makes this easy by applying a format to any cell that meets the condition you define.
In this tutorial, I will show you how to highlight the highest value, the lowest value, the top three or bottom three values, an entire row based on the highest value, and the highest value within each row. I also include a quick-reference table of every formula covered so you can copy exactly what you need.
To highlight the highest value in a column, select your data range, go to Format > Conditional Formatting, choose Custom formula is, and enter:
=B2=MAX($B$2:$B$21)
Replace the range with your actual data range, choose a highlight color, and click Done.
Formula Quick-Reference Table
| Goal | Formula | Apply to Range |
|---|---|---|
| Highlight highest value | =B2=MAX($B$2:$B$21) |
Score column only |
| Highlight lowest value | =B2=MIN($B$2:$B$21) |
Score column only |
| Highlight top 3 values | =B2>=LARGE($B$2:$B$21,3) |
Score column only |
| Highlight bottom 3 values | =B2<=SMALL($B$2:$B$21,3) |
Score column only |
| Highlight entire row (highest value) | =$B2=MAX($B$2:$B$21) |
Full dataset (A2:B21) |
| Highlight highest value per row | =B2=MAX($B2:$E2) |
Full dataset (B2:E21) |
How to Highlight the Highest Value in Google Sheets
Suppose you have a dataset with students’ names and scores, and you want to highlight the highest score.
Here are the steps to highlight the highest value using Conditional Formatting:
- Select the data range that has the scores.
- Click the Format option in the dropdown menu.
- Click on Conditional Formatting.
- In the Conditional format rules pane that opens, confirm the Single color option is selected.
- Confirm the range is correct. You can edit it directly in this pane if needed.
- In the Format rules drop-down, select Custom formula is.
- Enter the following formula in the field:
=B2=MAX($B$2:$B$21) - Choose the color you want to apply. The default green works well for highlighting a maximum value. If you don’t want to fill green, choose another color with the paint bucket.
- Click Done.
The cell with the highest value is now highlighted.
How Does This Work?
In Conditional Formatting, the custom formula must return either TRUE or FALSE. Google Sheets evaluates every cell in your selected range against that formula. When the formula returns TRUE, the formatting applies. When it returns FALSE, the cell is left unchanged.
In the formula above, Google Sheets visits each cell, checks whether the score in that cell equals the maximum score in the entire range, and highlights only the cell where that condition is true. If two or more cells share the max value, all of them will be highlighted. That is intentional behavior and exactly what you would expect.
How to Highlight the Lowest Value in Google Sheets
Highlighting the lowest value follows the same process. The only change is swapping MAX for MIN in the formula.
Suppose you have the same dataset and want to highlight the lowest score in column B.
- Select the range that has the scores.
- Click Format in the menu.
- Click Conditional Formatting.
- In the Conditional format rules pane, confirm Single color is selected.
- Confirm the range is correct.
- In the Format rules drop-down, select Custom formula is.
- Enter the following formula:
=B2=MIN($B$2:$B$21) - Choose a color that signals a low value. Red works well here for contrast with the green used on the maximum.
- Click Done.
The cell with the lowest score is now highlighted in red.
The same TRUE/FALSE logic applies here. Only the cell whose value equals the minimum value in the range returns TRUE, so only that cell receives the formatting. If two students share the same lowest score, both cells are highlighted.
Pro tip: You can run both rules on the same range at the same time. Apply the MAX rule with a green fill and the MIN rule with a red fill, and Google Sheets highlights both the highest and lowest values simultaneously without any conflict.
How to Highlight the Top or Bottom N Values
Instead of highlighting just the single highest or lowest value, you can highlight any number of top or bottom values. The logic stays the same. You just need a formula that returns TRUE for the cells that fall within your target range.
Suppose you want to highlight the top three scores in the dataset.
- Select the range that has the scores.
- Click Format in the menu.
- Click Conditional Formatting.
- In the Conditional format rules pane, confirm Single color is selected.
- Confirm the range is correct.
- In the Format rules drop-down, select Custom formula is.
- Enter the following formula:
=B2>=LARGE($B$2:$B$21,3) - Choose a highlight color and click Done.
The top three scores are now highlighted.
How Does the LARGE Formula Work?
The LARGE function returns the Nth largest value in a range. LARGE($B$2:$B$21,3) returns the third-highest score. The Conditional Formatting formula then checks whether each cell’s value is greater than or equal to that third-highest score. Any cell that meets the condition gets highlighted, which gives you the top three values.
To highlight the bottom three scores instead, use the SMALL function, which works the same way in reverse:
=B2<=SMALL($B$2:$B$21,3)
To highlight both the top three and bottom three at the same time, apply two separate Conditional Formatting rules to the same range: one using the LARGE formula with green fill, and one using the SMALL formula with a different color such as orange or yellow.
Make the N Value Dynamic
If you regularly change how many top or bottom values you want to highlight, hardcoding the number 3 in the formula means editing Conditional Formatting every time. A more flexible approach stores the number in a cell, say E1, and references it in the formula:
=B2>=LARGE($B$2:$B$21,$E$1)
Now you can type any number into cell E1 and the highlighting updates instantly across the entire range without touching the Conditional Formatting rule.
How to Highlight the Entire Row with the Highest or Lowest Value
So far, these examples only highlight the cell that contains the score. But what if you want to highlight the entire record, including the student’s name? This requires one small change to the formula: a mixed reference.
Suppose you want to highlight the full row for the student with the highest score.
- Select the entire dataset, for example A2:B21.
- Click Format in the menu.
- Click Conditional Formatting.
- In the Conditional format rules pane, select Single color.
- Confirm the range covers both columns.
- In the Format rules drop-down, select Custom formula is.
- Enter the following formula:
=$B2=MAX($B$2:$B$21) - Choose a highlight color and click Done.
The entire row for the student with the highest score is now highlighted.
Understanding Mixed References
The key difference in this formula is the dollar sign placement. Here is how the three reference types work in Google Sheets:
- B2 โ A relative reference. Both the column and row shift as Google Sheets moves through each cell.
- $B2 โ A mixed reference. The column is locked to B, but the row number adjusts as Google Sheets moves down.
- $B$2 โ An absolute reference. Both the column and row are fully locked.
Using $B2 ensures that even when Google Sheets evaluates the name cell in column A, the formula still checks the score in column B for that same row. Without the dollar sign on the column, the formula would check column A’s value against the max, which would never match and nothing would highlight.
This is one of the most important concepts to understand when building any row-level Conditional Formatting rule.
How to Highlight the Highest Value in Each Row
Sometimes your data is laid out with categories or subjects across multiple columns, and you want to highlight the best result within each individual row rather than across the entire dataset. This is common in scorecards, comparison tables, and multi-subject grade sheets.
Suppose your data spans columns B through E, with one row per student and one column per subject. To highlight the highest value in each row:
- Select the full data range, for example B2:E21.
- Click Format in the menu, then click Conditional Formatting.
- In the Format rules drop-down, select Custom formula is.
- Enter the following formula:
=B2=MAX($B2:$E2) - Choose a highlight color and click Done.
The formula uses a mixed reference on the range ($B2:$E2) to lock the columns while allowing the row number to shift downward as Google Sheets evaluates each row. The result is that only the highest value in each individual row gets highlighted, regardless of how it compares to scores in other rows.
Color Scale: A Useful Alternative
If you want to visualize the full spectrum of values rather than pinpoint specific highs and lows, Google Sheets includes a built-in Color Scale option under Conditional Formatting. Instead of highlighting a single cell, color scale applies a gradient across the entire range: typically red for low values, yellow for mid-range, and green for high values.
To use it, open the Conditional Formatting pane and click the Color scale tab instead of Single color. No custom formula is required.
The custom formula approach covered throughout this tutorial works best when you need to call out a specific value, such as the single highest score or the exact top three. Color scale works best when you want a visual overview of the full distribution at once.
Frequently Asked Questions
How do I highlight the highest value in Google Sheets?
Select your data range, go to Format > Conditional Formatting, and choose Custom formula is from the Format rules drop-down. Enter =B2=MAX($B$2:$B$21), adjusting the range to match your data. Choose a fill color and click Done. The cell with the highest value highlights immediately.
Can I highlight both the highest and lowest values at the same time?
Yes. Apply two separate Conditional Formatting rules to the same range. Use =B2=MAX($B$2:$B$21) with a green fill for the highest value, and =B2=MIN($B$2:$B$21) with a red fill for the lowest. Both rules run simultaneously without any conflict.
What happens if two cells share the same highest value?
Both cells are highlighted. The MAX formula returns TRUE for every cell that equals the maximum value in the range, so all tied cells receive the same formatting. This is expected behavior since you want to see every instance of that value.
How do I highlight the top 5 values instead of the top 3?
Change the second argument in the LARGE formula from 3 to 5. The formula becomes =B2>=LARGE($B$2:$B$21,5). You can substitute any number to highlight that many top values. For a fully dynamic version, put the number in a cell and reference it: =B2>=LARGE($B$2:$B$21,$E$1).
Why do I need a dollar sign to highlight an entire row?
The dollar sign in $B2 locks the column reference to column B while allowing the row number to adjust. This matters because when Google Sheets evaluates the name cell in column A, the formula needs to check column B for that same row. Without locking the column, the formula evaluates whatever column it is currently in, and the name cells never trigger the highlight.
Does Conditional Formatting with custom formulas work on the Google Sheets mobile app?
You can view existing Conditional Formatting rules on the Google Sheets mobile app. However, creating or editing custom formula rules requires the desktop version of Google Sheets in a browser. Set the rules up on desktop and they display correctly on mobile.
Can I highlight the highest value across multiple columns in the same row?
Yes. Select your full data range, open Conditional Formatting, choose Custom formula is, and enter =B2=MAX($B2:$E2), adjusting the column range to cover all the columns you want to compare. The dollar signs on the column letters lock the range to always span the same columns while the row number shifts as Google Sheets moves through each row.
Is there a way to highlight the highest value without a formula?
Yes. The Color Scale option under Conditional Formatting does not require any formula. It applies a gradient across your entire range, with the highest values appearing in one color (typically green) and the lowest in another (typically red). This works well for visualizing a distribution but does not isolate a specific value the way a custom MAX or MIN formula does.
Wrapping Up
Conditional Formatting in Google Sheets gives you a fast, formula-driven way to highlight the highest value, lowest value, top N values, bottom N values, or the best result in each row of your dataset. The core logic is simple: write a formula that returns TRUE for the cells you want to format, choose a color, and Google Sheets does the rest.
The mixed reference concept covered in the row-highlighting section is one of the most transferable skills in Google Sheets. Once you understand the difference between B2, $B2, and $B$2, you can apply it to any Conditional Formatting rule that spans multiple columns.
Leave a comment below if you have any questions.
Other Google Sheets tutorials you may also like:













