Conditional Formatting in excel
Conditional Formatting in excel
5. Click OK.
Result. Excel highlights the cells that are greater than 80.
Clear Rules
To clear a conditional formatting rule, execute the following steps.
5. Click OK.
Result. Excel calculates the average (42.5) and formats the cells that are
above this average.
Note: you can also use this category (see step 3) to highlight the top n
items, the top n percent, the bottom n items, the bottom n percent or cells
that are below average.
Explanation: always write the formula for the upper-left cell in the selected
range. Excel automatically copies the formula to the other cells. Thus, cell
A2 contains the formula =ISODD(A2), cell A3 contains the formula
=ISODD(A3), etc.
Color Scales
Use awesome color scales to assign different colors to different values.
This allows you to quickly identify high and low points in your dataset.
Tip: learn more about color scales and learn how to create this heat map.
Note: because we selected cell A1, Excel shows the rule applied to the
range A1:A10.
Data Bars
Data bars in Excel make it very easy to visualize values in a range of
cells. A longer bar represents a higher value.
1. Select a range.
Explanation: by default, the cell that holds the minimum value (0 if there
are no negative values) has no data bar and the cell that holds the
maximum value (95) has a data bar that fills the entire cell. All other cells
are filled proportionally.
Excel launches the Edit Formatting Rule dialog box. Here you can further
customize your data bars (Show Bar Only, Minimum and Maximum, Bar
Appearance, Negative Value and Axis, Bar Direction, etc).
Note: to directly launch this dialog box for new rules, at step 3, click More
Rules.
8. Select Number from the Minimum drop-down list and enter the value
100. Select Number from the Maximum drop-down list and enter the value
150.
9. Click OK twice.
Result.
Explanation: the cell that holds the value 100 (if any) has no data bar and
the cell that holds the value 150 (if any) has a data bar that fills the entire
cell. All other cells are filled proportionally.
Color Scales
Color Scales in Excel make it very easy to visualize values in a range of
cells. The shade of the color represents the value in the cell.
1. Select a range.
Result:
Excel launches the Edit Formatting Rule dialog box. Here you can further
customize your color scale (Format Style, Minimum, Midpoint and
Maximum, Color, etc).
Note: to directly launch this dialog box for new rules, at step 3, click More
Rules.
7. Select 2-Color Scale from the Format Style drop-down list and select
white and blue.
8. Click OK twice.
Result.
Icon Sets
Icon Sets in Excel make it very easy to visualize values in a range of
cells. Each icon represents a range of values.
1. Select a range.
Result:
Explanation: by default, for 3 icons, Excel calculates the 67th percent and
33th percent. 67th percent = min + 0.67 * (max-min) = 2 + 0.67 * (95-2)
= 64.31. 33th percent = min + 0.33 * (max-min) = 2 + 0.33 * (95-2) =
32.69. A green arrow will show for values equal to or greater than 64.31.
A yellow arrow will show for values less than 64.31 and equal to or greater
than 32.69. A red arrow will show for values less than 32.69.
Note: to directly launch this dialog box for new rules, at step 3, click More
Rules.
8. Select 3 symbols (Uncircled) from the Icon Style drop-down list. Select
No Cell Icon from the second Icon drop-down list. Change the Types to
Number and change the Values to 100 and 0. Select the greater than
symbol (>) next to the value 0.
9. Click OK twice.
Result.
Find Duplicates
Duplicate Values | Triplicates | Duplicate Rows
This page teaches you how to find duplicate values (or triplicates) and
how to quickly find duplicate rows in Excel.
Duplicate Values
To find and highlight duplicate values in Excel, execute the following
steps.
Note: select Unique from the first drop-down list to highlight the unique
names.
Triplicates
By default, Excel highlights duplicates (Juliet, Delta), triplicates (Sierra),
etc. (see previous image). Execute the following steps to highlight
triplicates only.
Note: you can use any formula you like. For example, use
=COUNTIF($A$1:$C$10,A1)>3 to highlight names that occur more than 3
times.
Duplicate Rows
To find and highlight duplicate rows in Excel, use COUNTIFS (with the
letter S at the end) instead of COUNTIF.
7. Finally, you can use the Remove Duplicates tool in Excel to quickly
remove duplicate rows. On the Data tab, in the Data Tools group, click
Remove Duplicates.
In the example below, Excel removes all identical rows (blue) except for
the first identical row found (yellow).
Shade Alternate Rows
Use Conditional Formatting | Apply a Table Style
Note: to apply the shading to the entire worksheet, select all cells on a
worksheet by clicking the Select All button (see orange arrow).
Result.
Explanation: the MOD function gives the remainder of a division. The ROW
function returns the row number of a cell. For example, for the seventh
row, MOD(7,2) = 1 because 7 divided by 2 equals 3 with a remainder of 1.
For the eight row, MOD(8,2) = 0 because 8 divided by 2 equals 4 with a
remainder of 0. As a result, all cells in even rows return 0 and will be
shaded.
Result.
To change the color shading from rows to columns, execute the following
steps.
5. First, select a cell inside the table. Next, on the Table Design tab, in the
Table Styles Options group, uncheck Banded Rows and check Banded
Columns.
Result.
Note: use the filter arrows to sort and filter this table. Visit our chapter
about tables to learn more about this topic.
To convert this table into a normal range of cells (with banded rows or
banded columns), execute the following steps.
6. First, select a cell inside the table. Next, on the Table Design tab, in the
Tools group, click Convert to Range.
Result.
Compare Two Lists
This page describes how to compare two lists using conditional
formatting. For example, you may have two lists of NFL teams.
To highlight the teams in the first list that are not in the second list,
execute the following steps.
1. First, select the range A1:A18 and name it firstList, select the range
B1:B20 and name it secondList.
8. To highlight the teams in the second list that are not in the first list,
select the range B1:B20, create a new rule using the formula
=COUNTIF(firstList,B1)=0, and set the format to orange fill.
Conflicting Rules
Sometimes multiple conditional formatting rules in Excel conflict. A
higher rule always wins. This example illustrates two different results.
1. The value 95 is higher than 80 but is also the highest value (Top 1). The
formats (yellow fill vs green fill and yellow text color vs green text color)
conflict. A higher rule always wins. As a result, the value 95 is colored
yellow.
Result:
2. Move the second rule up. The value 95 is the highest value (Top 1) but
is also higher than 80. The formats (green fill vs yellow fill and green text
color vs yellow text color) conflict. A higher rule always wins. As a result,
the value 95 is colored green.
Result:
Heat Map
To create a heat map in Excel, simply use conditional formatting. A heat
map is a graphical representation of data where individual values are
represented as colors.
5. Right click, and then click Format Cells (or press CTRL + 1).