What should I do if Excel conditional formatting does not take effect, is gray, or the result is incorrect?

Conditional formatting buttons are gray, rules are not colored, and duplicate values are incorrectly marked. These are three common problems. This article provides a judgment table based on symptoms, and then checks the protection status, formula return value, data format and rule priority one by one to help you find the cause and fix it.

Key points of this article

  • The conditional formatting button is gray. Most likely, the worksheet is protected, the file is in protected view, or the cell is being edited. Unrestrict it first before proceeding.
  • When a formula-based rule returns #N/A, Excel will treat it as "not established" and will not color it. Just wrap it with IFERROR or ISNUMBER.
  • Repeated value errors are often caused by spaces in the text, numbers stored as text, capitalization or application range errors. Use LEN and TRIM to check the data first.
  • When multiple rules coexist, check the order, application scope and "stop if true" option in the management rules

When you set conditional formatting for a column of data in Excel, you may encounter three situations: the color mark does not appear, the setting button is gray and does not move, or "Duplicate Values" marks clearly different data. These problems are very common in daily forms, and the reasons are often not intuitive and prone to trial and error.

This article is written for people who often do data sheets, reconciliation sheets or list checks. After reading this, you can first determine which type of problem it belongs to according to the symptoms, then check it in order, and finally know how to avoid it happening again next time. What this article talks about are general checking methods for Excel and do not involve the operation of specific software.

Why is Excel's conditional formatting gray, not colored, or inaccurate for repeated values? One sentence conclusion

Let’s talk about the conclusion first: if the button is gray, the priority is to check the protection and file status; if the rules are not colored, the priority is to check the formula return value; if duplicate values are not allowed, the priority is to check whether the data itself is clean. The causes of the three types of problems are different, and troubleshooting them together will waste a lot of time.

your situationRecommended practicesreason
The conditional formatting button is gray and cannot be clicked.First confirm that the worksheet is not protected, exit the cell editing state, and confirm that the file is enabled for editing.Protect and edit states disable formatting commands
Rules based on formulas are not colored, and the formula result is #N/AUse IFERROR or ISNUMBER to process formulas and return "false" on errorWhen a rule formula reports an error, Excel does not apply the format
Duplicate values mark data that should not be markedUse LEN and TRIM to check spaces and unify the format of numbers and textWhat appears to be the same content, the actual characters may be different
Multiple colors appear covering each other in the same areaOpen the management rules, adjust the order, and check the application scope of each ruleThe rules ranked first will affect the display of subsequent rules.
Duplicate values with different cases are not distinguishedUse custom EXACT-based formulas insteadBuilt-in "duplicate value" rules are not case sensitive

First determine what kind of problem it is

The table below can help you locate quickly. For each symptom, first check the common causes, and then use the method on the right to confirm.

symptomsCommon causesHow to confirm
Conditional formatting menu grayThe worksheet is protected, the file is in Protected View, and the cell is in editing stateLook at the top of the ribbon or table to see if there is a protected or protected view prompt; press Esc to exit editing and try again
Rules exist but are not coloredThe rule formula returns #N/A or other errors, or the referenced cells are written incorrectlyEnter the rule formula (referencing the same cell) in a blank cell and see if the result is TRUE, FALSE, or an error
The color range is incorrectThe scope of application is written incorrectly, or the formula uses relative referencesOpen the management rules and check the area address after "Apply to."
Duplicate values are incorrectly markedData may have hidden spaces, mixed numbers and text, case or case or inconsistent formattingCompare two seemingly identical cells and use LEN to compare the number of characters
Multiple colors clash with each otherIf multiple rules meet the conditions simultaneously, the higher-priority rule takes effectCheck the order in the management rules and check if the "Stop if true" option is checked

Inspect and fix each item one by one

The following steps are arranged from easy to difficult, and it is recommended to check them one by one. Most problems can be identified within the first four steps.

  1. Exit cell editing mode. Double-click the cell or press Esc to confirm the cursor is not inside any cell, then open the Conditional Formatting menu.
  2. Check the status of the documents. If the top of the table prompts "Protected Views," first enable editing, then restart. If the file comes from an older version, it may be in compatibility mode. Saving as the current version format usually allows normal settings.
  3. Check worksheet protection. Check the review menu to see if the worksheet is protected. If protected, it must be unlocked by someone who knows the password, or you can ask the other party to provide an editable copy.
  4. Open the management rules. In the conditional formatting menu, select Manage Rules, switch the scope to the current worksheet, and check rule types, formulas, and application scope item by item.
  5. Test the formula in a blank cell. Copy the formula from the rule to a blank space, check if the result is erroneous, and confirm whether the referenced cell is correct.
  6. Clean up data. Use TRIM to remove unnecessary spaces, and CLEAN to remove invisible characters, converting text numbers into numeric values.
  7. Adjust priorities. Move the rules that need to be displayed first, and if necessary, check "Stop if true" to avoid overwriting low-priority rules.

How to fix when the formula returns #N/A

If VLOOKUP or MATCH is used in the rule formula to find another region, if it cannot be found, it will return #N/A. Excel treats the incorrect result as a condition that doesn't apply, so cells are not colored, which on the surface looks like the rule is invalid.

The law is to wrap up the formula, making errors return as "false." For example, if you want to mark customers who have appeared in the list, you can write the formula =ISNUMBER(MATCH($A 2,Sheet2!$A:$ A, 0)), returns FALSE when not found, no longer reporting errors. If VLOOKUP is already in use, you can also write =IFERROR (original formula, FALSE).

Note that the #N/A displayed in cells is different from conditional formatting. If the #N/A in the table is a normal result, you don't need to forcibly remove it; just confirm that the lookup value is written correctly.

How to fix incorrect duplicate values

The built-in duplicate value rule has several features: it does not distinguish between case and lowercase, only compares values within the cell, and when selecting multiple columns, each column is usually judged separately. If the results are incorrect, you can check the following three points in order.

  • Spaces: "A" and "A" are treated as different values. Use =LEN(A2) to compare the number of characters, and after finding any extra characters, clean them up with TRIM.
  • Numbers and text: Numbers exported from the system are often in text format and will not be considered the same as manually entered numbers. After selecting this column, if a green triangle appears in the upper left corner of the cell and prompts "Numbers stored in text form," you need to use a unified format.
  • Case sensitivity: If case-sensitive, you can use a custom formula =SUMPRODUCT(--EXACT($A$2:$A$100,$A 2))>1 and set the application range from A2 to A100.

Additionally, if the rule is applied to only one column, it will not consider the content of other columns in the same row. When comparing entire rows, you should reference multiple columns in the formula at once, or concatenate the key columns first before making a judgment.

How to Prevent It from Happening Next Time

Prevention is much less effort than post-event inspection. The following habits can reduce most problems.

  • Fixed data entry format. Key columns such as number, date, and amount are uniformly formatted before entry, and data imported from outside is first checked for text-type digits.
  • Clean up once after entry. For columns to be matched, first use TRIM to handle spaces, then set conditional formatting to avoid invisible characters affecting the results.
  • Few but clear rules. Try to keep only one or two rules in the same area, and write down the purpose of each rule for easier priority checks later.
  • Clearly state the formula reference. For cross-table lookups, use the complete range address, test the formula results in the blank areas, and only apply them to the entire column after confirming they are correct.
  • Check the protection status before sharing. If you need to let someone else edit the table, first confirm that the protection settings meet expectations to avoid being unable to modify the format after they open it.

❓ Frequently Asked Questions (FAQ)

1. Can conditional formatting reference data from other worksheets?

Yes, but be careful with the wording. Older versions of Excel do not allow direct references to other worksheets in rules. In this case, you can first define a name for the target area and then reference that name in the rules.

2. What should I do if the conditional formatting gets messed up after copying and pasting?

Regular paste will bring over the source cell's format and rules, possibly overwriting the original settings. If you only want to keep the values, use the "Values" option in Paste; If you only want to copy the format, use Format Brush.

3. If you want to compare whether two columns of data are duplicated, how do you write the formula?

Use =COUNTIF(Sheet2!{ in rules) {F1}} A,$A 2)>0 indicates that a value in column A has appeared in column A of another worksheet. Note that this comparison is also affected by spaces and text formatting, so try to clean up the data before making a comparison.

4. Why are colors marked by the same rule not uniform?

This is usually because the formula uses relative references, and the reference positions change accordingly when applied to different cells. Check the dollar sign in the formula and fix the column or row to lock; the result usually returns to normal.

📝 Summary

When there is a problem with conditional formatting, first distinguish whether the button is gray, the rule is not colored, or the duplicate value is inaccurate, then check in the order of protection status, formula return value, and data quality. In most cases, removing protection, handling errors with IFERROR, and cleaning hidden characters can solve the problem. Developing the habit of using a unified format before entering can ensure the conditional format remains stable and reliable over the long term.

Open OmniDoc and process your table file

Updated 2026-11-11