How can I use an IF statement to turn a cell color red in Excel?

The IF statement in Excel can be used to turn a cell color red by setting a specific condition that will change the cell’s color if met. This can be done by using the “Conditional Formatting” feature and specifying the desired condition and color. This allows for the visualization of data and makes it easier to identify important or critical information in a spreadsheet. Additionally, the IF statement can also be used in conjunction with other functions to create more complex conditional formatting rules. Using an IF statement to change cell color in Excel is a simple and efficient way to organize and analyze data.

Excel: Use IF Statement to Turn Cell Color Red


Often you may want to use an IF statement to turn a cell color red in Excel if it meets a certain condition.

The following example shows how to do so in practice.

Example: Use IF Statement to Turn Cell Color Red in Excel

Suppose we have the following dataset in Excel that shows the number of points scored by various basketball players:

Now suppose that we would like to turn each cell in the Points column red if it has a value less than 20.

To do so, highlight the cells in the range B2:B13, then click the Conditional Formatting dropdown menu on the Home tab and then click New Rule:

In the new window that appears, click Use a formula to determine which cells to format, then type =B2<20 in the box, then click the Format button and choose a red fill color to use.

Once we press OK, all of the cells in the range B2:B13 that have a value less than 20 will now be red:

Excel use IF statement to turn cells red

Note that in this example we turned each cell color red that had a value less than 20, but you can use whatever formula you’d like as the rule for determining which cells should be red.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Excel: Apply Conditional Formatting if Cell Contains Text

x