How to change cell color in Excel based on value

Supposing you want to shade a cell (says A1) with a certain background color if cell B4 meets the criteria such as has a certain value or the value is greater or less than a specific number. What would you do? This article will show you the method.

Shade a cell based on another cell value with Conditional Formatting

Shade a cell based on another cell value with Conditional Formatting

You can do as follows to shade a cell based on another cell value in Excel.

1. Select the cell (says A1) you want to shade based on another cell value, then click Conditional Formatting > New Rule under the Home tab.

How to change cell color in Excel based on value

2. In the New Formatting Rule dialog box, you need to:

  • 2.1 Select Use a formula to determine which cells to format option in the Select a Rule Type box;
  • 2.2 If you want to shade cell A1 when value of B4 is greater than 500, then enter formula =$B4>500 into the Format values where this formula is true box;
    Tips: if you want to shade cell A1 when B4 has a certain value such as “test”, the use this formula =$B4=“test”. You can change the variable in the formula based on your needs.
  • 2.3 Click the Format button to specify a background color;
  • 2.4 Click the OK button when it returns to the New Formatting Rule dialog box. See screenshot:

How to change cell color in Excel based on value

Then you can see the specified cell is shaded based on the value of another cell as below screenshot shown.

How to change cell color in Excel based on value

Related articles:

  • How to apply color banded rows or columns in Excel?

How to change cell color in Excel based on value

This Excel tutorial explains how to use conditional formatting to change the fill color of a cell based on the value of another cell in Excel 2010 (with screenshots and step-by-step instructions).

Question: In Microsoft Excel 2010, I'm trying to apply a fill color to a cell based on the value in an adjacent cell. How can I do this?

Answer: If you wish to change the fill color in a cell based on the value of an adjacent cell, you will need to apply conditional formatting.

In this example, we have a table in cells Q1 to S10 that display the fill colors that we want to apply for each rock type. So in this example, we want to display a yellow fill color if the Rock Type is Shale, an orange fill color if the Rock Type is Quartz, and so on.

We use a VLOOKUP in cell F14 to F16 to pull the appropriate Rock Type from the Q1:S10 table. Now the hard part. We want to display the corresponding fill color in cells E14 to E16 based on the Rock Type returned. We are unable to use a VLOOKUP to pull the fill color, so we will have to use conditional formatting.

How to change cell color in Excel based on value

To do this, select the range of cells that you wish to apply the conditional formatting to. In this example, we've selected cells E14 to E16. Then select the Home tab in the toolbar at the top of the screen. Then in the Styles group, click on the Conditional Formatting drop-down and select Manage Rules.

How to change cell color in Excel based on value

When the Conditional Formatting Rules Manager window appears, click on the "New Rule" button to enter the first condition.

How to change cell color in Excel based on value

When the New Formatting Rule window appears, select Use a formula to determine which cells to format as the rule type.

Then type the following formula:

=F14="Shale"

Next, we need to select what formatting to apply when this condition is met. To do this, click on the Format button.

How to change cell color in Excel based on value

When the Format Cells window appears, select the formatting conditions that you wish to apply. In this example, we've selected yellow as the Fill Color. Then click on the OK button.

How to change cell color in Excel based on value

When you return to the New Formatting Rule window, you should see the preview of the formatting in the Preview box. In this example, the preview box shows the fill color of yellow. Next click on the OK button.

How to change cell color in Excel based on value

This will return you to the Conditional Formatting Rules Manager window. You can now view the first conditional formatting condition. We will need to add a condition for each fill color by clicking on the New Rule button and repeating the previous steps.

How to change cell color in Excel based on value

Once all of the conditions have been entered, you should see something like the picture below. Click on the OK button.

How to change cell color in Excel based on value

Now when you return to the spreadsheet, the conditional formatting will be applied in cells E14 to E16.

How to change cell color in Excel based on value

How to change cell color in Excel based on value

This Excel tutorial explains how to use conditional formatting to change the font color based on the value of a cell in Excel 2010 (with screenshots and step-by-step instructions).

Question: In Microsoft Excel 2010, I'm putting the sum of 3 cells in a 4th cell. If the sum is greater than 10, I would like the sum to be the color red. If the sum is less than 10, I would like the sum to be the color blue. Is this possible?

Answer: If you wish to change the color of the font based on the value in a cell, you will need to apply conditional formatting.

To do this, select the cell that you wish to apply the formatting to. In this example, we've selected cell B8.

How to change cell color in Excel based on value

Select the Home tab in the toolbar at the top of the screen. Then in the Styles group, click on the Conditional Formatting drop-down and select Manage Rules.

How to change cell color in Excel based on value

When the Conditional Formatting Rules Manager window appears, click on the "New Rule" button to enter the first condition.

How to change cell color in Excel based on value

When the New Formatting Rule window appears, select Format only cells that contain as the rule type.

Then select Cell Value in the first drop down, greater than in the second drop down, and enter 10 in the final box. In our example, we've selected when the cell value is greater than 10.

Next, we need to select what formatting to apply when this condition is met. To do this, click on the Format button.

How to change cell color in Excel based on value

When the Format Cells window appears, select the formatting conditions that you wish to apply. We've changed the Color to Red. Then click on the OK button.

How to change cell color in Excel based on value

When you return to the New Formatting Rule window, you should see the preview of the formatting in the Preview box. In this example, the preview box shows the text in red. Next click on the OK button.

How to change cell color in Excel based on value

This will return you to the Conditional Formatting Rules Manager window.

If you wish to apply more than one condition, you will need to click on the New Rule button again.

How to change cell color in Excel based on value

When the New Formatting Rule window appears, we need to set up the second condition.

Select Format only cells that contain as the rule type.

Then select Cell Value in the first drop down, less than in the second drop down, and enter 10 in the final box. In our example, we've selected when the cell value is less than 10.

Next, we need to select what formatting to apply when this second condition is met. To do this, click on the Format button.

How to change cell color in Excel based on value

When the Format Cells window appears, select the formatting conditions that you wish to apply to the second condition. We've changed the Color to Blue. Then click on the OK button.

How to change cell color in Excel based on value

When you return to the New Formatting Rule window, you should see the preview of the formatting in the Preview box. In this example, the preview shows the text in blue. Next click on the OK button.

How to change cell color in Excel based on value

We've added two different conditions. When you're done, click on the OK button.

How to change cell color in Excel based on value

Now when you return to the spreadsheet, the conditional formatting will be applied. As you can see, the value in cell B8 appears in red.

How to change cell color in Excel based on value