*Steps in this article will apply to Excel 2007-2016. Images were taken using Excel 2016.
If you are a fan of Excel’s conditional formatting feature, you probably find looking for even more and more ways to highlight useful information in your data. A question that often comes up among these “conditional formatting addicts” is Can I use If/Then formula to format a cell?
The answer is yes and no. Any conditional formatting argument must generate a TRUE result, meaning that at a literal level, your conditional formatting rule is an If/Then statement along the lines of “If this condition is TRUE, THEN format the cell this way”.
What conditional formatting can’t do in a single rule is an IF/THEN/ELSE condition such as “If # is greater than 10 format red, else format green”. Instead, this would require TWO rules, one for “greater than 10” and one for “less than 10”.
Let’s look at a few scenarios to get a sense of how we can create the effect of IF/THEN conditional formatting, even if we can’t use it in the feature itself:
To follow using our examples, download 04-If-Then Conditional Formatting.xlsx
Scenario 1 (Birthdays tab): You want to highlight all employees in your department who have a birthday this month with Red, and all other departments blue.
Solution: Create two rules – one for your department, one for all others
Step 1 – Highlight birthdays in your department
The formula to identify birthdays in the current month will be (see this article for more about using dates in conditional formatting):