The tutorial explains all main features of Excel conditional formatting with examples. You will learn how to do conditional formatting in any version of Excel, efficiently use preset rules or create new ones, edit, copy and clear formatting.
Excel conditional formatting is a really powerful feature when it comes to applying different formats to data that meets certain conditions. It can help you highlight the most important information in your spreadsheets and spot variances of cell values with a quick glance.
Many users, especially beginners, find it intricate and obscure. If you feel intimidated and uncomfortable with this feature, please don't! In fact, conditional formatting in Excel is very straightforward and easy to use, and you will make sure of this in just 5 minutes when you have finished reading this tutorial :)
What is conditional formatting in Excel?
Excel Conditional Formatting is used to apply certain formatting to data that meets one or more conditions. Just like usual cell formatting, it lets you highlight and differentiate your data in various ways by changing cells' fill color, font color, border styles, etc. The difference is that it is more flexible and dynamic - when the data changes, conditional formats get updated automatically to reflect the changes.
Conditional formatting can be applied to individual cells or entire rows based on the value of the formatted cell itself or another cell. To conditionally format your data, you can utilize preset rules such as Color Scales, Data Bars and Icon Sets or create custom rules where you define when and how the selected cells should be highlighted.
Where is conditional formatting in Excel?
In all versions of Excel 2010 through Excel 365, conditional formatting resides in the same place: Home tab > Styles group > Conditional formatting.
Now that you know where to find conditional formatting in Excel, let's move on and see how you can leverage it in your daily work to make more sense of the project you are currently working on.
For our examples, we will use Excel 365, which seems to be the most popular version these days. However, the options are essentially the same in all Excels, so you won't have any problems with following no matter what version is installed on your computer.
How to use conditional formatting in Excel
To truly leverage the capabilities of conditional format, you need to learn how to utilize various rule types. The good news is that whatever rule you are going to apply, it defines the two key things:
- What cells are covered by the rule.
- What condition should be met.
So, here's how you use Excel conditional formatting:
- In your spreadsheet, select the cells you want to format.
- On the Home tab, in the Styles group, click Conditional Formatting.
- From a set of inbuilt rules, choose the one that suits your purpose.
As an example, we are going to highlight values less than 0, so we click Highlight Cells Rules > Less Than… - In the dialog window that appears, enter the value in the box on the left and choose the desired format from the drop-down list on the right (default is Light Red Fill with Dark Red Text).
When done, Excel will show you a preview of formatted data. If you are happy with the preview, click OK.
In a similar manner, you can use any other rule type that is more appropriate for your data, such as:
- Greater than or equal to
- Between two values
- Text that contains specific words or characters
- Date occurring in a certain range
- Duplicate values
- Top/bottom N numbers
How to use a preset rule with custom formatting
If none of the predefined formats suits you, you can choose any other colors for cells' background, font or borders. Here's how:
- In the preset rule dialog box, from the drop-down list on the right, pick Custom Format…
- In the Format Cells dialog window, switch between the Font, Border and Fill tabs to choose the desired font style, border style and background color, respectively. As you do this, you will immediately see a preview of the selected format. When done, click OK.
- Click OK one more time to close the previous dialog window and apply the custom formatting of your choice.
Tips:
- If you want more colors than the standard palette provides, click the More Colors… button on the Fill or Font tab.
- If you wish to apply a gradient background color, click the Fill Effects button on the Fill tab and choose the desired options.
How to create a new conditional formatting rule
If none of the preset rules meets your needs, you can create a new one from scratch. To get it done, follow these steps:
- Select the cells to be formatted and click Conditional Formatting > New Rule.
- In the New Formatting Rule dialog box that opens, select the rule type.
For example, to format cells with percent change less than 5% in either direction, we choose Format only cells that contain, and then configure the rule like shown in the screenshot below: - Click the Format… button, and then choose the Fill or/and Font color you want.
- Click OK twice to close both dialog windows and your conditional formatting is done!
Excel conditional formatting based on another cell
In the previous examples, we highlighted cells based on "hardcoded" values. However, in some cases it makes more sense to base your condition on a value in another cell. The advantage of this approach is that irrespective of how the cell value changes in future, your formatting will adjust automatically to respond to the change.
As an example, let's highlight prices in column B that are greater than the threshold price in cell D2. To accomplish this, the steps are:
- Click Conditional formatting> Highlight Cells Rules > Greater Than…
- In the dialog box that pops up, place the cursor in the text box on the left (or click the Collapse Dialog icon), and select cell D2.
- When done, click OK.
As a result, all the prices higher than the value in D2 will get highlighted with the selected color:
That is the simplest case of conditional formatting based on another cell. More complex scenarios may require the use of formulas. And you can find several examples of such formulas along with the step-by-step instructions here:
Apply multiple conditional formatting rules to same cells
When using conditional formats in Excel, you are not limited to only one rule per cell. You can apply as many rules as your business logic requires.
For example, you can create 3 rules to highlight prices higher than $105 in red, higher than $100 in orange, and higher than $99 in yellow. For the rules to work correctly, you need to arrange them in the right order. If the "greater than 99" rule is placed first, then only the yellow formatting will be applied because the other two rules won't have a chance to be triggered - obviously, any number that is higher than 100 or 105 is also higher than 99 :)
To re-arrange the rules, this is what you need to do:
- Select any cell in your dataset covered by the rules.
- Open the Rules Manager by clicking Conditional Formatting > Manage Rules…
- Click the rule that needs to be applied first, and then use the upward arrow to move it to top. Do the same for the second-in-priority rule.
- Select the Stop If True check box next to all but the last rule because you do not want the subsequent rules to be applied when the prior condition is met.
What is Stop if True in Excel conditional formatting?
The Stop If True option in conditional formatting prevents Excel from processing other rules when a condition in the current rule is met. In other words, if two or more rules are set for the same cell and Stop if True is enabled for the first rule, the subsequent rules are disregarded after the first rule is activated.
In the example above, we have already used this option to ignore subsequent rules when the first-in-priority rule applies. That usage is quite evident. And here are another couple of examples where the use of the Stop If True function is not so obvious but extremely helpful:
How to edit Excel conditional formatting rules
To make some changes to an existing rule, proceed in this way:
- Select any cell to which the rule applies and click Conditional Formatting > Manage Rules…
- In the Rules Manager dialog box, click the rule you want to modify, and then click the Edit Rule… button.
- In the Edit Formatting Rule dialog window, make the required changes and click OK to save the edits.
That dialog window looks very similar to the New Formatting Rule dialog box used for creating a new rule, so you won't have any difficulties with it.
Tip. If you don't see the rule you want to edit, then select This Worksheet from the Show formatting rules for drop-down list at the top of the Rules Manager dialog box. This will display the list of all the rules in your worksheet.
How to copy Excel conditional formatting
To apply a conditional format you've created earlier to other data, you won't need to re-create a similar rule from scratch. Simply use Format Painter to copy the existing conditional formatting rule(s) to another data set. Here's how:
- Click any cell with the formatting you want to copy.
- Click Home > Format Painter. This will change the mouse pointer to a paintbrush.
Tip. To copy the formatting to multiple non-contiguous cells or ranges, double-click Format Painter.
- To paste the copied formatting, click on the first cell and drag the paintbrush down to the last cell in the range you want to format.
- When done, press Esc to stop using the paintbrush.
- Select any cell in your new dataset, open the Rules Manager and check the copied rule(s).
Note. If the copied conditional formatting uses a formula, you may need to adjust cell references in the formula after copying the rule.
How to delete conditional formatting rules
I've saved the easiest part for last :) To delete a rule, you can either:
- Open the Conditional Formatting Rules Manager, select the rule and click the Delete Rule button.
- Select the range of cells, click Conditional Formatting > Clear Rules and choose the option that fits your needs.
This is how you do conditional formatting in Excel. Hopefully, these very simple rules we created were helpful to get a grasp of the basics. Below, you can find a few more tutorials that can help you understand the inner mechanics and expand conditional formatting in your spreadsheets far beyond its traditional uses.
Practice workbook for download
Excel conditional formatting - examples (.xlsx file)
314 comments
Hello,
I am trying to use conditional Formatting > Format only cells that contain>cell value between (then I have the values copies from a seperate sheet. I have created 4 different rules with 4 different values. The first two rules work, but the 3rd, and 4th do not. The weird thing is if I move up my third rule to the second position it will work, but it is still only the first two rules that will work. Please help!
Rules:
Cell Value Between ='Employee List'!$B$2 and ='Employee List'!$B$16
Cell Value Between ='Employee List'!$B$20 and ='Employee List'!$B$30
Cell Value Between ='Employee List'!$B$34 and ='Employee List'!$B$39
Cell Value Between ='Employee List'!$B$43 and ='Employee List'!$B$70
Hi,
The information you provided is not enough to understand your case and give you any advice, sorry. You haven't written what formulas you are using.
Pay attention to the following paragraph of the article above: "Apply several conditional formatting rules to one cell — Using "Stop If True" in conditional formatting rules"
If you describe the problem in more detail, I will try to help you.
I need to highlight a cell that doesn’t contain 48
Hello!
Please check out the following article on our blog, it’ll be sure to help you with your task:Excel formulas for conditional formatting
Enter formula
=ISERROR(SEARCH("48",A1,1))
Hi
I have a cell with a % range in it ie 1-2% and in the next cell I want the LMs to suggest a % increase within the range. However if they go over that range ie 2.5% I want that cell to flag red, is this possible?
Hello!
Sorry, it's not quite clear what you are trying to achieve. For me to be able to help you better, please describe your task in more detail. Here is the article that may be helpful to you: How to change background color in Excel based on cell value
Hi Alexander
For example
Column A will have a list of % ranges that managers can choice to apply a % increase within:
1-2%
2.25-2.3%
2-3%
And so on
In Column B, I only want them to choice a % within that range. If they go over I’d like it to flag up/highlight
Hello- I need your help with conditional format formula. I want it to highlight cell A1 if cell A1 is 50% less than B1. Also if I have a lot of cells with 0 i want to make sure there is no color.
I after that I can create same formula different percentages.
thank you,
Le
Hello!
Please try the following formula:
=A1/B1<=0.5
Good day.
I have a spread sheet of 300+ line. I want to add a formula what hides values what is the same amount, but opposite (positive and negetive).
A1 -35,00
A2 -34,80
A3 -33,26
A4 -15,00
A5 32,12
A6 33,26
A7 34,80
Example:
A1 - Stay
(A2,A7) Hide Same number, but opposite value(positive and negative)
(A3,A6) Hide Same number, but opposite value(positive and negative)
A4 - Stay
A5 - Stay
Thank you
I already answered you!
I want to copy from one sheet to another.
If the total of the cell is > 499.00
I want to copy the entire row into another sheet in the same workbook
Dear Concern,
I am very novish in using Excel, I am a business man, for my own business I have to make my Inventory Management System.From viewing Youtube I have almost built my system but in some case I am stuck. In my "Stock Out" section when stock out command quantity is more than (Opening qty+Stock In qty) there I want "SHORT" word should appear. But this thing I cannot do. Can you Please help me in this issue,how can i solve it.
Thanks with regards
Wahid
Hello Wahid!
I think you could find it helpful to learn how to use the IF function.
Please feel free to read this tutorial on our blog: https://www.ablebits.com/office-addins-blog/if-function-excel/
If you have additional questions, I will be delighted to answer them.
Hello i want a doubt to be cleared!
so when i am applying conditional formatting for a cell which is which four different conditions
1, i need red colour when i use the formula to determine the cells to format For eg there is another cell, when the condition is met then i need it red.
2, when i am using format only cells that contains - in that i have given blanks, and no format
3, I need yellow when i am using the format only cell that contain - in that i given cell value - and select equal and i select a cell to which it should be equal.
4, the last one is i am using format only top and bottom ranked values - in that i give bottom - and i select 1 and i give a colour to that.
the problem is it is not displaying as the way i need there is some mismatch happening.
Could you please help with this. Thank you in advance.
Difference between conditional formatting and regular formatting
***Select the range E2:E30 and create a new conditional formatting rule that uses a formula to apply yellow fill and bold font to values that sold for less than or equal to 70% of the sticker price.****
The only thing i'm stuck at is the formula. can any one help me figure it out.
Thanks.
Is there a way to create conditional formatting in a line graph? I have created a monte carlo simulation and I have only graphed the first 50 series on the line graph. I would like to make the lines that are above $1 green and the lines below $1 red.
I want to make a two different colour in the same column if the number is double mins two times then it will be yellow and the other hand number will be more then two times then it will be red
in versions of 2010, 2013& 2016 and 2017, 2018, 2019 in all ms word, ms excels& ms power point all Groups, all Tool Bars names And DETAILS send me in and all shortcuts KEYS sent me
in now all in now
for me my G- mail ID
In Excel new formatting, use a formula to determine which cells to format, im trying to create a formula to change the font color based on a cell value of B10 (+/-0.007) IE Anything beetween 9.9993 and 10.0007 should be "True" is that possible?
how to copy conditional format from one cell to rows, which drag formulas to rang of rows
how to copy condintion format from one cell to rows
Hi experts, can you please tell me how to move the date on a plot(x axis)back to the bottom once I have changed to y axis to a logarithmic scale?
I'm trying to format whole rows based on the data in column AB, using formula =$AB10>0 but it doesn't highlight anything. What am I doing wrong?
The data in column AB is currency, and I need the rows highlighted if the value in AB is greater than $0.00.
Hello, I am tring to color code a Rank of numbers in a single column. This column contains positive, zero, and negative numbers. I have 3 conditional rules, for 1,2, & 3 places
1st Place the CF is (Cell Value equal to) =LARGE($G$235:$G$264,1)
2nd Place the CF is (Cell Value equal to) =LARGE($G$235:$G$264,2)
3rd Place the CF is (Cell Value equal to) =LARGE($G$235:$G$264,3)
My test numbers are: -4, -2, 4, 0, 2
First place is 4, correct. Second Place is 2, correct, Third place is -2, wrong. It should be zero.
Can you help ?
Thanks
Show the names of employees in blue text color who have salary greater than or equal to 3000 and show the names in green text color for those earning less than 3000.