You are on page 1of 21

Unit 2

Data
Manipulation
& Analysis
Data Presentation:
Conditional Formatting
Guideline
• Conditional Formatting.

22
Conditional Formatting

• Conditional formatting lets you specify formatting for a cell


range on the basis of the contents of the cell range. For example,
given exam scores for students, you can use conditional
formatting to display in red the names of students who have a
final average of less than 60.

• You can apply conditional formatting to a cell, a range of cells,


the entire worksheet, or the entire workbook. Usually, you apply
conditional formatting to a range of cells that contains values
you want to highlight, if conditions warrant.

33
Conditional Formatting Options
• To view the conditional formatting options, first select the range
you want to format. Then, on the Home tab, in the Styles group,
click the Conditional Formatting arrow to open a menu of
conditional formatting options.

• Conditional formatting menu:

44
Conditional Formatting Options
• Highlight Cells Rules allows you to assign a format to cells whose
contents meet one of the following criteria:
– Are within a specific numerical range
– Match a specific text string
– Are within a specific range of dates (relative to the current date)
– Occur more than once (or only once) in the selected range

• Top/Bottom Rules allows you to assign a format to any of the


following:
– N largest or smallest values in a range
– Top or bottom n percent of numbers in a range
– Numbers above or below the average of all the numbers in a range

55
Conditional Formatting Options
• Data Bars, Color Scales, and icon Sets allow you to easily identify
large, small, or intermediate values in the selected range. Larger
data bars are associated with larger numbers.

• With color scales you might, for example, have smaller values
appear in red and larger values in blue, with a smooth transition
applied as values in the range increase from small to large.

• With icon sets, you can use as many as five symbols to identify
different ranges of values. For example, you might display an arrow
pointing up to indicate a large value, pointing to the right to
indicate an intermediate value, and pointing down to indicate a
small value.
66
Conditional Formatting Options
• New Rule allows you to create your own formula to determine
whether a cell should have a specific format. For example, if a cell
exceeds the value of the cell above it, you could apply the color
green to the cell. If the cell is the fifth-largest value in its column,
you could apply the color red to the cell, and so on.

• Clear Rules allows you to delete all conditional formats you have
created for a selected range or for the entire worksheet.

• Manage Rules allows you to view, edit, and delete conditional


formatting rules, create new rules, or change the order in which
Excel applies the conditional formatting rules you have set.
77
Conditional Formatting
• Assume you have the following data, and you want to
highlight any cell value that has hours worked greater than 70
with an orange background and a white font color.

88
Conditional Formatting Steps
• Select the range D4:D12.
• Click the Conditional Formatting button (Home tab | Styles
group) to display the Conditional Formatting list and select
New Rule.

99
Conditional Formatting Steps
• Click ‘Format only cells that contain’ in the Select a Rule Type
area (New Formatting Rule dialog box) to change the ‘Edit the
Rule Description’ area
• In the ‘Edit the Rule Description’ area, click the box arrow in
the relational operator box (second text box) to display a list
of relational operators, and then select greater than to select
the desired operator
• Select the rightmost box, and then type 70 in the box in the
‘Edit the Rule Description’ area to enter the second value of
the rule description

10
10
Conditional Formatting Steps

11
11
Conditional Formatting Steps
• Click the Format button (New Formatting Rule dialog box) to
display the Format Cells dialog box
• If necessary, click the Font tab. Click the Color box arrow
(Format Cells dialog box) to display the Color gallery and then
click White, Background 1 in the Color gallery to select the
font color
• Click the Fill tab (Format Cells dialog box) to display the Fill
sheet and then click the orange color to select the
background color

12
12
Conditional Formatting Steps

13
13
Conditional Formatting
• As you saw, the second text box in the New Formatting Rule
dialog box allows you to select a relational operator, such as
less than, to use in the condition.

14
14
Conditional Formatting
• After creating conditional formatting rules, you can view your rules
by clicking Manage Rules on the Conditional Formatting menu.

• In the Conditional Formatting Rules Manager dialog box, you can:


■ Create a rule by clicking the New Rule button.
■ Edit or change a rule by clicking the Edit Rule button.
■ Delete a rule by selecting it and then clicking the Delete Rule
button.
■ Change the order of precedence by selecting a rule and then
clicking the up arrow or down arrow.
15
15
Conditional Formatting- Text Example
• Apply conditional formatting to Delivery column to highlight
those rows where a cell contains the word “Worldwide”. Note
this is partial matching. E.g. “Ships worldwide” should be
highlighted.

16
16
Conditional Formatting- Text Example
• Select the entire rows since you want to highlight rows not
single cells.
• Select Conditional Formatting, choose New Rule.
• Select Use a formula to determine which cells to format.
• In the formula section type =SEARCH("Worldwide", $B2) -
format selected rows if a corresponding cell in column B
contains the word "Worldwide". This formula will find all such
cells, regardless of where the search text is located in a cell,
e.g. "Ships Worldwide", "Worldwide, except for…" etc.
• Note that we used Relative Referencing to keep the rows
relative and lock the column $B2.
17
17
Conditional Formatting- Text Example

18
18
Conditional Formatting- Formulas
Example
• Highlight cells that contain a formula. In this example, there
are values in cells A2:B8, and totals in cells C2:C8 and in
A9:C9

19
19
Conditional Formatting- Dates Example
• Highlight payments that are due in the next thirty days. In this
example, Due dates are entered in cells A2:A4.

20
20
Conditional Formatting- Color Scale
Example
• Show hot temperatures in a red cell, and cold temperatures in
a blue cell.

21
21

You might also like