Highlight Row Maximum and Lowest Nonzero Values in Excel
Question details
Highlight the maximum and lowest nonzero numeric values in each row without creating separate rules for every row.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A large table needs two conditional formatting rules applied across all data rows.
- Observed behavior
- Each row's maximum and lowest nonzero values should receive distinct formatting automatically.
Identify the first data cell and the full data range, excluding headers. The examples below use B2:CW201; adjust both the formulas and the selected range to match your table.
Create Two Formula-Based Conditional Formatting Rules in Excel
Apply two rules to the entire table so Excel evaluates the values separately for each row.
The dollar signs fix the row's boundary columns while the row number and tested cell reference adjust across the selected range. The lowest-nonzero rule includes negative values.
Select B2:CW201, with B2 as the active cell. Replace this example range with your own data range.
Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =AND(ISNUMBER(B2),B2=MAX($B2:$CW2)), choose Format, select a fill color, and click OK.
With the same range selected, create another formula-based rule. Enter =AND(ISNUMBER(B2),B2<>0,B2=MINIFS($B2:$CW2,$B2:$CW2,"<>0")), choose a different fill color, and click OK.
Open Home > Conditional Formatting > Manage Rules and confirm that both rules apply to =$B$2:$CW$201, or to your equivalent full data range.

Highlight Row Extremes in WPS Spreadsheet
Use formula-based conditional formatting in WPS Spreadsheet to highlight each row's maximum and lowest nonzero value across a selected table.
- 1. Open and select the table: Open your workbook in WPS Spreadsheet and select the data range, such as B2:CW201, with B2 as the active cell.
- 2. Create the maximum rule: On the Home tab, open Conditional Formatting and create a formula-based rule using =AND(ISNUMBER(B2),B2=MAX($B2:$CW2)). Choose a fill color.
- 3. Create the lowest nonzero rule: Add a second formula-based rule using =AND(ISNUMBER(B2),B2<>0,B2=MINIFS($B2:$CW2,$B2:$CW2,"<>0")) and choose a different fill color.
- 4. Verify the result: Use Conditional Formatting > Manage Rules to check that both rules cover the full table, then save the workbook.

Frequently Asked Questions
Will the rules highlight negative numbers?
Yes. The lowest-nonzero formula uses the criterion "<>0", so negative numbers are included. To highlight the lowest positive value instead, change the criterion to ">0" and replace B2<>0 with B2>0.
What happens when a row contains only zeros or blank cells?
The lowest-nonzero rule highlights nothing because there is no qualifying value. The maximum rule can highlight numeric zeros, but its ISNUMBER check prevents blank cells from being highlighted.
Why are several cells highlighted in the same row?
Conditional formatting highlights every value that matches the row's maximum or lowest nonzero value. If there are ties, multiple cells receive the same formatting.
How do I apply the rules to a different table size?
Select your data range before creating the rules, replace B2 with its first cell, and replace $B2:$CW2 with the first row's actual boundaries. Check the full range under Home > Conditional Formatting > Manage Rules.
What if Excel does not recognize MINIFS?
MINIFS is available in Excel 2019 and later and Microsoft 365. If your version does not support it, update Excel or use a compatible alternative formula.




