How to Check If Excel Cells Have the Same Color with Conditional Formatting
Question details
The user is looking for a way to verify if multiple cells share the same background color when that color is applied dynamically via conditional formatting.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Attempting to write a formula or function to compare the colors of different cells to see if they match, but the colors were generated by conditional formatting rules rather than manual fill formatting.
- Observed behavior
- Standard formulas and user-defined functions fail to read the cell color because displayed formatting properties are evaluated after the worksheet calculation phase, making dynamic color checking unreliable.
Review the specific logical rules or formulas used in your conditional formatting setup, as you will need to replicate these conditions rather than reading the physical color itself.
Use Helper Columns with Matching Logic
Since formulas cannot directly read dynamic colors, the best approach is to recreate the condition's logic in a helper column to output a standard value for comparison.
Normal formulas and User-Defined Functions (UDFs) cannot access displayed formatting during worksheet calculation. The displayed format is valid only after calculation completes and may change during the next calculation cycle.
Insert a new blank column directly next to the data range that contains the conditional formatting you want to evaluate.
Enter a formula that mimics the exact logical rule driving your conditional formatting. For example, if your formatting colors cells greater than 50, enter =A2>50 into the helper cell.
Select the bottom-right corner of the helper cell and drag it down to apply the formula across all relevant rows in your dataset.
Use a standard comparison formula (such as =B2=C2) to check if the helper cells output the same result. A 'TRUE' result confirms the cells share the same underlying condition and therefore the same color.

Extract Displayed Colors Using a VBA Macro
If your conditional formatting rules are too complex to replicate, you can run a VBA macro after the spreadsheet calculates to extract the color values as raw data.
Easily Manage Conditional Formatting in WPS Spreadsheet
WPS Spreadsheet handles complex conditional formatting and helper column logic flawlessly. As a comprehensive data analysis tool, it allows you to easily recreate conditions, manage large datasets, and use advanced logical formulas to compare values.
- 1. Open Your Data: Launch WPS Spreadsheet and open your existing workbook containing the conditionally formatted data.
- 2. Insert Helper Columns: Right-click on the column header next to your data and select 'Insert Column'.
- 3. Write the Logical Formula: Type the exact condition used for your formatting (e.g., =A1>100) into the formula bar and press Enter.
- 4. Compare Values: Use simple comparison formulas to evaluate the results, achieving a 100% accurate match check without relying on cell color properties.

Frequently Asked Questions
Can I use the older GET.CELL formula to check conditional formatting colors?
No. The GET.CELL macro function can only read standard background fill colors that were applied manually. It cannot detect dynamic colors applied by conditional formatting rules.
Is there a way to filter or sort by conditional formatting colors?
Yes. Unlike formulas, the built-in 'Filter by Color' and 'Sort by Color' tools located in the Data tab can successfully recognize and organize cells based on their displayed conditional formatting colors.
Why can't User-Defined Functions (UDFs) read DisplayFormat?
Microsoft Excel restricts UDFs from evaluating the DisplayFormat property during the calculation cycle because conditional formatting is prioritized to render only after all mathematical calculations in the sheet are complete.




