To highlight a cell or cells conditionally in spreadsheets, there is a built-in option called conditional formatting. We can use that conditional formatting option to highlight the max value in a row in Google Sheets. See the example below.
In the below example let’s see how to highlight a max value cell in a row, or in each row. This method will be useful in visually finding max scores, max sales extra from a horizontal data range.
As a side note, to find the max/large value in Google Doc Sheets, we can use the function Max or Large. To return a max value conditionally, I mean If + Max, then use Maxifs.
Example to Max Value Highlighted Row-wise in Sheets:
In my above Sheets, the max value in row # 3 (B3
As a result, the max value highlighted in each row is the cells that containing the number 12.
Custom Google Sheets Formula to Highlight Max Value in a Row
The formula to use within conditional formatting may be slightly different from the formula that you use in a spreadsheet cell.
Formula Rule 1:
=B3:M3=max($B3:$M3)
or
=B3=max($B3:$M3)
You can use this custom formula in conditional formatting as below.
In the above example, the range to highlight is limited to B3
My custom formula will work in an infinite range too. But you may face one issue. The formula will also highlight all the blank rows with the blue color that, of course, you may not want to see happen.
How to Skip Blank Rows in Max Value Conditional Formatting?
To exclude blank rows in conditional formatting there is a quick trick. No need to change the above formatting rule! Just apply an additional rule as below and choose the fill color as “White”.
Formula Rule 2:
=B3:M3=MIN($B3:$M3)
This MIN formula does the trick. But make sure that you have moved this rule to the
If you don’t want to use and extra rule to skip the blank rows in the max formatting, then use the below formula instead of the Formula Rule 1. Do not use Formula Rule 2.
Formula Rule 3:
=and(B3=max($B3:$M3),len(B3))
Note: If there are more than one max value in any row, all the max values in that rows will be highlighted.
Hope you have learned how to highlight max value in a row in Google Sheets. Enjoy!
Additional Resources:
- Date Related Conditional Formatting Rules in Google Sheets.
- Role of Indirect Function in Conditional Formatting in Google Sheets.
- Highlight an Entire Row in Conditional Formatting in Google Sheets.
- How to Highlight Vlookup Result Value in Google Sheets.
- Highlight Intersecting Value in Google Sheets in a Two Way Lookup.