Standard conditional formatting in Excel evaluates a cell's own value to decide how it should look. For example, you might turn a cell red when its number drops below 20. But what if you want to format one cell (or an entire row) based on the value in a different cell or column? That is conditional formatting based on another cell and it requires a formula-based rule.
Instead of choosing a preset like "Less Than" or "Greater Than," you select "Use a formula to determine which cells to format" in the New Rule dialog and write a formula that points to the reference column. Excel evaluates that formula for each cell in your target range and applies the formatting whenever the formula returns TRUE.
This technique is useful in a wide range of business scenarios:
This approach works in Excel 2007 through Microsoft 365 and follows the same general steps in every version. You can find additional techniques and version-specific guidance across our full library of Excel tutorials. If you are new to Excel formulas, Pryor Learning's guide to Excel formula syntax is a helpful starting point.
Every conditional formatting formula that references another cell follows the same pattern. You select the range you want to format, create a new rule using "Use a formula to determine which cells to format" and enter a formula that points to the reference column.
The generic template looks like this:
=$ReferenceColumn2 = condition
For example, if your data starts in row 2 and you want to format cells in column A whenever column D contains a value greater than 100, your formula would be =$D2>100. The dollar sign before the column letter locks the reference to column D while the row number (2) stays relative so it adjusts for every row in your selected range.
Getting cell references right is the single most important step when applying conditional formatting based on another column. There are three reference types:
When you apply a formula rule across a range, use a mixed cell reference to lock the column reference (e.g., $B2). If you forget the dollar sign before the column letter, Excel will shift the reference sideways as it moves across columns and your rule will evaluate the wrong data.
Steps in this article will apply to Excel 2007-2016. Images were taken using Excel 2016.
Conditional formatting is a useful Excel feature that can help you quickly scan your data without resorting to complicated filtering or building full charts in Excel.
Often, you will use conditional formatting to call attention to cells that represent an outlying condition – such as too many days until delivery or too few items in inventory.
The following example demonstrates Excel's built-in conditional formatting presets, which format a cell based on its own value. If you need to format cells based on a value in a different column, the formula-based approach is covered in the sections that follow.
Here's how to use conditional formatting to show us that an item in our store is getting low on inventory and we will need to re-order soon:
To follow using our example, download 03-Conditional Formatting Across Multiple Cells.xls

I'm sure you have already spotted a problem! There are many rows in our worksheet. Do I have to repeat the above for every cell in the column? Of course, the answer is "no" and Excel gives you a few quick ways to apply conditional formatting to multiple cells.
The easiest way to apply conditional formatting to an entire column or row is to select the full target range before you define your rule. To highlight every cell with a value below twenty in our example, your steps would look like this:

If you forget to select your range, or your range changes after you've applied the rule, you can modify it after the rule has been created:

Once a conditional formatting rule has been applied to a cell, the rule will also apply to any cell that is copied from the original. This means you can copy/paste the rule (along with its contents!) and even use the copy handle to drag and copy the rule. Caution! Just like any other formula, you will need to pay attention to your absolute, relative and mixed cell references so that your conditional formatting rules apply correctly. This is especially important when your rule references another column — use a mixed reference like $B2 to lock the column while allowing the row to adjust.
To delete your rule from multiple cells:
To delete all rules from your sheet:
Now that you understand the mechanics, here are five practical formulas you can use to highlight cells based on another cell value. In each example, assume your data starts in row 2 and you have already selected the target range before creating a new rule with "Use a formula to determine which cells to format."
| Use Case | Formula | What It Does |
|---|---|---|
| Numeric threshold in another column | =$D2<20 | Formats the target cell when column D's value is less than 20 |
| Text match in another column | =$C2="Overdue" | Formats the target cell when column C contains the word "Overdue" |
| Highlight entire row by status | =$F2="Complete" | Applied to a full row range (e.g., $A2:$G100), shades the entire row when column F reads "Complete" |
| Compare two columns | =$A2<>$B2 | Highlights cells where column A and column B do not match |
| Check for blanks in another column | =ISBLANK($E2) | Formats the target cell when column E is empty |
Remember to use mixed cell references in every formula. Lock the column with a dollar sign ($D2) and leave the row relative so the rule evaluates each row independently.
If your conditional formatting based on another cell is not working as expected, check for these common mistakes:
Conditional formatting based on another cell is one of the most practical skills you can add to your Excel toolkit. An advanced Excel training program can help you build on this foundation with macros, PivotCharts and other power-user techniques. Download the practice file referenced in this article and try building a few formula-based rules of your own. Once you are comfortable with mixed references, you can move on to advanced techniques like nested formulas, data validation dashboards and dynamic reports.
For more information about how to apply conditional formatting based on formulas and how to highlight entire rows of data, view this article: Get the Most Out of Excel's Conditional Formatting