
Create Custom Conditional Formatting Rules in Excel
Create Custom Conditional Formatting Rules in Excel
Excel's built-in conditional formatting presets cover most common scenarios, but sometimes you need something more specific. Custom rules — especially formula-based rules — give you complete control over when and how formatting is applied.
Creating a New Rule
- Select the cells you want to format.
- Go to Home → Conditional Formatting → New Rule.
- Choose a rule type from the list.
The most powerful option is Use a formula to determine which cells to format. This lets you write any Excel formula as the condition.
Formula-Based Rules
When you use a formula as a condition, Excel evaluates it for each cell. If the formula returns TRUE, the format is applied. If it returns FALSE, it is not.
Example: To highlight entire rows where the Status column (column C) says Overdue, select the entire data range, create a New Rule, choose formula-based, and enter a formula that checks whether column C in the current row equals Overdue. Lock the column reference but leave the row reference relative so it checks each row independently.
Highlight Entire Rows
Formula-based rules are particularly powerful for highlighting entire rows based on one column's value. Select all columns in your data range, write a formula referencing the key column with a locked column but unlocked row reference. The rule highlights the full row wherever the condition is met.
Alternating Row Colors
To apply alternating row shading without a table style, use a formula-based rule with the MOD function. A formula that checks whether the row number divided by 2 has a remainder of zero returns TRUE for every even row. Apply a light gray fill to those rows for a clean alternating stripe effect.
Managing Rules
Go to Conditional Formatting → Manage Rules to see, edit, reorder, and delete all rules applied to the current selection or the entire sheet. Use the up and down arrows to change rule priority. Rules higher in the list take precedence.