Excel Practice Test

โ–ถ

What Is Conditional Formatting in Excel?

Conditional formatting in Excel lets you change how cells look โ€” color, font, border โ€” based on their values. Instead of manually scanning rows of data, you set rules once and Excel highlights what matters automatically. It's one of the most practical tools in the whole program, and once you get comfortable with it, you'll wonder how you ever read spreadsheets without it.

Here's the core idea: you pick a range of cells, define a condition (like "greater than 100" or "contains the word Error"), and choose a format to apply when that condition is true. Excel checks every cell in real time. Change a number, and the formatting updates instantly.

You can use conditional formatting for things like:

It doesn't change the cell's value โ€” just its appearance. That's important to remember when you're working with formulas elsewhere in the sheet.

How to Apply Conditional Formatting: The Basics

To get started, select the cells you want to format. Then go to the Home tab and click Conditional Formatting in the Styles group. You'll see a dropdown with several built-in options.

The quickest path for most tasks is Highlight Cells Rules. Here's how that works:

  1. Select your data range (e.g., B2:B50)
  2. Click Home → Conditional Formatting → Highlight Cells Rules
  3. Choose a rule type โ€” Greater Than, Less Than, Equal To, Between, Text That Contains, A Date Occurring, or Duplicate Values
  4. Enter your threshold value and pick a format from the dropdown (red fill, yellow fill, custom, etc.)
  5. Click OK

That's it. Excel applies the format to every cell matching your rule and keeps updating as data changes.

For dates, the "A Date Occurring" option is particularly useful โ€” you can highlight cells containing today's date, dates in the last 7 days, next month, and more without writing any formulas yourself.

Color Scales, Data Bars, and Icon Sets

Beyond simple highlight rules, Excel has three visual tools that make large datasets a lot easier to scan at a glance.

Color Scales

A color scale applies a gradient across a range based on relative values. The most common setup uses three colors โ€” for example, red for the lowest values, yellow for the middle, and green for the highest. You're not setting specific thresholds; Excel calculates the gradient based on the actual min and max in your range.

To apply one: select your range → Conditional Formatting → Color Scales → pick a preset. You can also click More Rules to customize the midpoint and choose your own colors.

Color scales work well for things like performance metrics, survey scores, or any dataset where you want to see the full distribution rather than just exceptions.

Data Bars

Data bars turn each cell into a mini bar chart. The longest bar represents the largest value in the range; shorter bars are proportional. You can show bars with or without the actual numbers โ€” the option is in the rule settings under "Show Bar Only."

Go to: Conditional Formatting → Data Bars → choose a gradient or solid fill style.

These are great for budget reports, sales comparisons, or anywhere you're comparing quantities across rows.

Icon Sets

Icon sets add small symbols to cells โ€” arrows, traffic lights, stars, flags โ€” based on thresholds you define. For example, a green circle for values above 80, a yellow triangle for 60-79, and a red X below 60.

Go to: Conditional Formatting → Icon Sets → pick a set. Then open More Rules to adjust the threshold percentages or switch from percent-based to number-based cutoffs.

A quick tip: if you want the icons but not the numbers, check "Show Icon Only" in the rule settings. Useful for clean dashboards where the icon communicates everything.

Test Your Excel Knowledge

Using Formulas for Custom Conditional Formatting Rules

The built-in rules cover a lot of ground, but custom formula-based rules are where conditional formatting really gets powerful. Instead of checking a single cell's value, you can write a formula that looks at other cells, compares across rows, or applies logic that no preset can handle.

To create a formula-based rule:

  1. Select your range (e.g., A2:E20)
  2. Conditional Formatting → New Rule
  3. Choose "Use a formula to determine which cells to format"
  4. Enter your formula โ€” it must return TRUE or FALSE
  5. Set the format and click OK

The formula you write should be relative to the top-left cell of your selected range. Excel will shift it for each row and column automatically.

Highlight an Entire Row

Say you have a task list in A2:D20, and column C contains status values like "Done" or "Pending". To highlight every completed row in gray:

The dollar sign before C locks the column reference. That way, Excel checks column C for every row, even as it shifts the formula across columns A through D.

Highlight Cells Above the Average

Formula: =B2>AVERAGE(:0)

This highlights each cell that's higher than the average of the entire range. Use absolute references for the AVERAGE range so it doesn't shift as Excel evaluates each row.

Alternate Row Colors (Zebra Stripes)

Formula: =MOD(ROW(),2)=0

This applies formatting to every even-numbered row. Swap 0 for 1 if you want odd rows highlighted instead. It's a clean way to make dense tables easier to read without touching your actual data or table styles.

Managing Multiple Conditional Formatting Rules

Once you've added a few rules to a range, managing them gets important โ€” especially when rules conflict or overlap.

Open the rules manager with: Conditional Formatting → Manage Rules. You'll see all the rules applied to the current selection (or the whole sheet if you change the dropdown). From here you can:

The priority order matters a lot. If you have one rule for "greater than 100" in green and another for "greater than 50" in yellow, a cell with value 120 would match both. The rule listed first wins. Arrange them intentionally.

"Stop If True" is useful when your rules are exclusive categories โ€” once a cell qualifies for one, you don't want it checked against others. It can also slightly improve performance on large ranges.

Conditional Formatting With Tables and Named Ranges

If your data is formatted as an Excel Table (Insert → Table), conditional formatting integrates smoothly. Apply a rule to a column and it automatically extends when you add new rows โ€” no need to re-apply the rule manually. This is one good reason to keep your data in proper tables rather than plain ranges.

Named ranges work well too. Instead of writing :00 in your rule, you can define a named range called "Sales" and write that directly. It's easier to read and maintain, especially when you're sharing workbooks or revisiting them months later.

To name a range: select it → Name Box (top left corner, next to the formula bar) → type a name → Enter.

Common Issues and Fixes

Rules not applying to the right cells โ€” double-check the "Applies to" range in the rules manager. It's easy to accidentally apply a rule to a single cell when you meant to apply it to a whole column.

Formula-based rules not working โ€” the most common culprit is mixed-up cell references. Remember: write the formula as if you're in the top-left cell of your selection, use $ signs to lock what shouldn't move.

Formatting disappearing after copy-paste โ€” if you paste over cells with existing conditional formatting, the pasted rules can conflict or override. Use Paste Special → Values to paste without bringing formatting along.

Too many rules slowing down the file โ€” conditional formatting rules are evaluated every time Excel recalculates. On very large ranges with many rules, this adds up. Try to consolidate rules and avoid applying them to entire columns (like A:A) when you only need a few hundred rows. If you want to learn more about Excel formulas, formula-based rules become even more flexible when you're comfortable with functions like COUNTIF, ISBLANK, and AND/OR.

Can I apply conditional formatting based on another cell's value?

Yes โ€” use a formula-based rule. For example, to format cells in column B based on column A, select B2:B20 and write a formula like =>10. The $ locks the column reference so Excel checks column A for each row.

How do I copy conditional formatting to another range?

Select the formatted cells, copy them (Ctrl+C), then select the target range and use Paste Special → Formats (or press Ctrl+Alt+V and choose Formats). The rules copy over without pasting actual values.

Why is my formula-based rule not working?

Most formula rule problems come down to cell references. Make sure you're writing the formula as if you're in the top-left cell of your selection, and use $ signs to lock references that shouldn't shift as Excel moves down rows or across columns.

Can I use conditional formatting in Excel Online?

Yes, Excel Online supports conditional formatting including highlight rules, color scales, data bars, and icon sets. Formula-based rules work too, though the interface is slightly simplified compared to the desktop app.

How do I remove conditional formatting from cells?

Select the cells, go to Conditional Formatting → Clear Rules → Clear Rules from Selected Cells. To remove all rules from the entire sheet, choose Clear Rules from Entire Sheet.

Does conditional formatting slow down Excel?

It can, especially if you apply rules to entire columns or have many overlapping rules. Keep rules limited to the actual data range (e.g., B2:B1000 instead of B:B) and delete unused rules to keep files responsive.

Practical Use Cases Worth Knowing

Conditional formatting gets more useful the more you think creatively about what conditions matter in your data. Here are some real-world setups worth having in your toolkit.

Deadline Tracking

In a project tracker, use a formula like =AND(C2<TODAY(),D2<>"Done") to highlight overdue tasks. Column C has the due date; column D has the status. This flags anything past due that isn't marked complete โ€” and updates every day when you open the file.

Duplicate Detection Without a Helper Column

Select your list, then use Highlight Cells Rules → Duplicate Values. Excel highlights every value that appears more than once. You can also use a formula โ€” =COUNTIF(:00,A2)>1 โ€” if you want more control over what counts as a duplicate or need to apply it alongside other rules.

Gradebook Color Coding

Apply icon sets to a grade column with custom thresholds: green check for 90+, yellow dash for 70-89, red X below 70. Switch the threshold type from Percent to Number in the rule settings. It gives teachers (or anyone managing scores) an instant visual summary without sorting or filtering.

Budget vs. Actual Comparison

In a budget spreadsheet, use a formula like =C2>B2 to highlight cells in column C (Actual) that exceed column B (Budget). Pair it with a data bar on the actual column for a quick two-layer visual โ€” the bar shows magnitude, the red highlight flags overruns. You can build on this further when you learn how to how to use Excel for financial tracking and reporting.

Heat Map for Survey Results

Select your matrix of survey scores, apply a three-color color scale (red→yellow→green), and you've got a heat map. It's one of the clearest ways to present survey data โ€” patterns show up immediately without any charts or pivot tables. If you're already comfortable with pivot tables in Excel, combining a pivot with conditional formatting is one of the most efficient ways to build executive-ready dashboards.

Keyboard Shortcuts for Conditional Formatting

If you work with conditional formatting regularly, a few shortcuts save time:

The F5 → Special trick is particularly handy when you inherit a workbook and want to see where all the formatting rules are before you start editing. For more ways to work faster, the full list of Excel shortcuts cheat sheet is worth keeping nearby.

Conditional formatting rewards the time you put into learning it. Start with the built-in highlight rules, then work your way toward formula-based rules once you're comfortable. The more you use it, the more patterns you'll start to see in your own data โ€” and the faster you'll be able to surface them for anyone reading your spreadsheets.

โ–ถ Start Quiz