I have applied conditional formatting in two columns and i want if one of it is coloured and nothother is not it should be filtered.
Assistant
To clarify your goal:
User
can we use formula for it?
Assistant
Yes, you can use formulas to achieve exactly this. Since Excel cannot filter by conditional formatting color directly, your best approach is to mimic the conditional formatting logic with formulas.
Step-by-step with formulas
Identify the condition behind each conditional formatting.
For example, if your conditional formatting colors a cell when the value is greater than 100 in Column A, and when the text is "Pass" in Column B.
Add helper columns with formulas to detect those conditions.
Add a final formula that returns TRUE when exactly one of those helper conditions is TRUE.
User
no. i have green and white color and i want to filter it
Assistant
You have two columns with conditional formatting applied.
You want to filter the data so that only rows where one column is colored (due to conditional formatting) and the other is NOT colored appear.
Unfortunately, Excel's Filter feature cannot directly detect the color applied by conditional formatting since conditional formatting colors are dynamic and not considered cell formatting that filters can use.
How to Achieve This
You need to create helper columns with formulas that replicate the conditional formatting logic and return TRUE or FALSE (or 1/0), which can then be used for filtering.
Step 1: Understand your conditional formatting rules
Suppose:
Column A has a conditional format based on a rule we’ll call RuleA.
Column B has a conditional format based on a rule we’ll call RuleB.
You will recreate these rules as formulas in two helper columns.
Step 2: Add helper columns for detecting the formats
Let's say your data starts in row 2.
In column C (Helper 1), enter a formula that returns TRUE if Column A meets RuleA:
excel
= (the_condition_for_Column_A)
In column D (Helper 2), enter a formula that returns TRUE if Column B meets RuleB:
excel
= (the_condition_for_Column_B)
Step 3: Add a combined helper column to detect “one colored only”
In column E (Helper 3), enter a formula that returns TRUE if exactly one of Column A or B criteria is TRUE:
excel
= (C2<>D2)
This means one is TRUE (colored) and the other is FALSE (not colored).
Copy these formulas down your data range.
Step 4: Filter based on the helper column
Apply a filter on column E.
Filter to show only TRUE.
Example
Assuming your conditional formatting rule for Column A is:
Cell contains value > 50
and for Column B:
Cell contains text "Complete"
Your formulas would be:
C2 (Column A condition):
excel
= A2 > 50
D2 (Column B condition):
excel
= B2 = "Complete"
E2 (One colored only):
excel
= (C2<>D2)
Filter Column E for TRUE to show rows where only one column meets the condition.
Summary
Convert conditional formatting logic to formulas in helper columns.
Use a formula to check if only one of the two columns meets the formatting condition.
Filter based on that formula.
If you share specific conditional formatting rules or data samples, I can help craft the exact formulas!
Filter your data based on that final TRUE/FALSE formula.
Example formula setup
Assuming:
Column A has conditional formatting if A2 > 100.
Column B has conditional formatting if B2 = "Pass".
In C2 (helper 1):
excel
= A2 > 100
In D2 (helper 2):
excel
= B2 = "Pass"
In E2 (final helper):
excel
= C2<>D2
This means, E2 = TRUE if exactly one condition is true (so only one column is "colored" by your logic).
How to apply filter:
Select all your data including helper columns.
Turn on filtering (Data tab > Filter).
Filter column E to show only TRUE.
Summary:
Yes, you can use formulas instead of filtering by color.
Formulas replicate conditional formatting logic and work for filtering.
Use a helper column for each condition + a final helper to check "only one condition true".
Filter on the final helper column.
If you want, share your exact conditional formatting rules, and I can write the exact formulas for you!
Thanks for the clarification! You have two columns with cells colored either Green or White, and you want to filter rows where exactly one of the two columns is green and the other is white.
Important: Excel cannot filter by conditional formatting colors directly.
But if the colors come from conditional formatting, they are based on rules, and those rules can be replicated in formulas to identify "green" and "white" logically.
Two cases:
Case 1: Colors come from conditional formatting rules (I.e., the green/white colors follow a certain condition)
If so, you can use those conditions and write formulas on helper columns to detect green cells.
Case 2: Colors were manually applied (no rules)
Excel formulas can not check manually applied fill colors.
You’d need VBA or a macro to detect colors, or add a helper column manually.
How to proceed:
Step 1: Replicate the conditional formatting condition in helper columns
For example:
A (col1)
B (col2)
Comment
Green/White
Green/White
colored by CF
Let’s say the cells in Column A turn Green if the value >100, and White otherwise, similarly for Column B.
Add helper columns C and D:
C (Helper for A)
D (Helper for B)
Formula example
=A2>100
=B2>50
TRUE if green condition met, FALSE if white.
Step 2: Add final helper to detect exactly one green
In column E:
excel
= C2<>D2
TRUE means one column is green, the other is white.
FALSE means both same (both green or both white).
Step 3: Filter by E = TRUE
Apply a filter on column E.
Select TRUE only — that filters rows where exactly one of the two columns is green.
If your colors are not based on formulas/conditional formatting, here's a VBA method to detect color:
VBA function to check cell fill color
vba
Function IsGreen(cell As Range) As Boolean
' Example: check if cell color is RGB green (adjust RGB if needed)
If cell.Interior.Color = RGB(0, 176, 80) Then ' Green color code example
IsGreen = True
Else
IsGreen = False
End If
End Function
Use in Excel:
In C2:
excel
=IsGreen(A2)
In D2:
excel
=IsGreen(B2)
In E2:
excel
= C2<>D2
Then filter column E by TRUE.
Summary
Best if colors come from conditional formatting rules: replicate rule with formulas.
If colors are manual, Excel formulas alone can't detect — use VBA UDF for color check.
Once you detect which cells are green in helper columns, use a formula comparing columns to find rows where exactly one column is green.
Filter on that final helper column.
If you want, I can help you write the exact formula or VBA if you provide:
How green color is assigned (the rule or manually?)