Conditional Formatting if Two Cells Are Not Equal in Excel

Conditional formatting is used to apply specific formatting to cells that meet certain conditions or criteria, like when two cells are not equal. In Excel, you can set up conditional formatting rules to highlight cells that are not equal to each other. Here's how you can do it:

  1. Select the cells where you want to apply the conditional formatting. For example, let's say you want to compare cells A1 and B1.
  2. Click on the "Home" tab in the Excel ribbon.
  3. In the "Styles" group, click on "Conditional Formatting" and then select "New Rule."
  4. In the "New Formatting Rule" dialog box, choose "Use a formula to determine which cells to format."
  5. In the "Format values where this formula is true" box, enter the formula to compare the two cells. In our example, the formula would be =A1<>B1. The <> symbol is used to denote "not equal to."
  6. Click on the "Format" button to choose the formatting you want to apply when the condition is met. For example, you can change the fill color, font color, or apply other formatting options.
  7. Click "OK" to close the "Format Cells" dialog box.
  8. Click "OK" again to close the "New Formatting Rule" dialog box.

Now, the conditional formatting will be applied to the selected cells, highlighting them if the two cells are not equal. If you want to apply this rule to other cells, you can adjust the formula accordingly or use the Format Painter tool to copy the formatting to other cells.

Example

Let's say you have a list of products and their prices in column A and column B, and you want to highlight the rows where the prices in column A and B are not equal. Here's how you can set up the conditional formatting for this example:

  1. Select the cells where you want to apply the conditional formatting, e.g., A2:B10.
  2. Click on the "Home" tab in the Excel ribbon.
  3. In the "Styles" group, click on "Conditional Formatting" and then select "New Rule."
  4. In the "New Formatting Rule" dialog box, choose "Use a formula to determine which cells to format."
  5. In the "Format values where this formula is true" box, enter the formula to compare the two cells in each row. In this example, the formula would be =A2<>B2.
  6. Click on the "Format" button to choose the formatting you want to apply when the condition is met, such as changing the fill color.
  7. Click "OK" to close the "Format Cells" dialog box.
  8. Click "OK" again to close the "New Formatting Rule" dialog box.

Now, the rows where the prices in column A and B are not equal will be highlighted with the chosen formatting.

Did you find this useful?