Formatting Issues

Color Excel IF Formula Results with Conditional Formatting

Amos GikundaAmos Gikunda Nov 12, 2026 869 views

Question details

Apply conditional formatting to cells containing IF formula results so that OK displays in blue and ERROR displays in red.

Color Excel IF Formula Results with Conditional Formatting
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user uses an IF formula, such as =IF(A1=B1,"OK","ERROR"), and wants the returned text to receive automatic color formatting.
Observed behavior
Formula result cells should show OK in blue and ERROR in red based on their displayed values.
Before you start

Confirm that the IF formula already returns consistent text values, such as OK and ERROR, with no extra spaces. Select only the formula result cells before creating the formatting rules.

Solution 1Recommended

Create separate conditional formatting rules for OK and ERROR

Use this method when the result cells display text returned by an IF formula and each result needs its own font color.

Conditional formatting evaluates the displayed value in each selected result cell. Your IF formula can remain unchanged while Excel applies the colors automatically.

1
Select the IF formula results

Select the cells that contain the IF formulas, for example C2:C100, where each cell returns OK or ERROR.

2
Add the OK rule

On the Home tab, select Conditional Formatting > Highlight Cells Rules > Equal To. Enter "OK", choose Custom Format, set the Font color to blue, and select OK.

3
Add the ERROR rule

With the same range selected, choose Home > Conditional Formatting > Highlight Cells Rules > Equal To. Enter "ERROR", choose Custom Format, set the Font color to red, and select OK.

4
Check the rule range

Select Home > Conditional Formatting > Manage Rules and confirm that both rules apply to the intended result-cell range, such as =$C$2:$C$100.

Create separate conditional formatting rules for OK and ERROR
Formula stays the same: You can keep a formula such as =IF(A1=B1,"OK","ERROR"). The colors update automatically whenever the formula result changes.
Conditional Formatting in WPS Spreadsheets

Color IF Results Automatically in WPS Spreadsheets

WPS Spreadsheets lets you use the same IF formula logic and conditional formatting rules to color returned text such as OK and ERROR. Create value-based rules from the Home tab, choose font colors, and let WPS update the formatting as worksheet values change.

  1. 1. Open the worksheet in WPS Spreadsheets: Open the Excel workbook in WPS Office and select the cells containing the IF formula results.
  2. 2. Create the OK formatting rule: Go to Home > Conditional Formatting > Highlight Cells Rules > Equal To, enter OK, and set the font color to blue.
  3. 3. Create the ERROR formatting rule: Create another Equal To rule from Home > Conditional Formatting, enter ERROR, and set the font color to red.
  4. 4. Review the applied range: Open Home > Conditional Formatting > Manage Rules to confirm both rules cover all formula result cells.
Create separate conditional formatting rules for OK and ERROR results.Keep IF formulas unchanged while formatting updates automatically.Open, edit, and save Microsoft Excel .xlsx and .xls files.Use a familiar spreadsheet interface for Excel-style formatting tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can conditional formatting color text returned by an IF formula?

Yes. Select the cells containing the IF results, then create conditional formatting rules based on the cell value being equal to text such as "OK" or "ERROR".

Why does my OK rule not apply to the formula result?

Check that the rule text exactly matches the formula output, including spaces and capitalization. Also open Home > Conditional Formatting > Manage Rules and verify the Applies to range includes the formula cells.

Do I need to change =IF(A1=B1,"OK","ERROR") to use colors?

No. Leave the IF formula as it is. Conditional formatting changes the appearance of the returned value without modifying the formula.

How do I change an existing conditional formatting color in Excel?

Select a formatted cell, go to Home > Conditional Formatting > Manage Rules, select the relevant rule, choose Edit Rule, then select Format to choose a different font color.