Lab Activity 4
Lab Activity 4
Conditional formatting
Conditional formatting allows you to make data trends stand out visually.
Open the file excellab4.xslx and navigate to the condForm sheet. Let us say we would like to quickly
view who has OT (Over Time hours) more than 10 hours.
In the Home tab, click on Conditional Formatting in the Styles group. Move the mouse pointer over
Highlight Cells Rules, and then click Greater Than.
Other conditional formatting features allow you to get a quick overview of the values of all cells in a
range. One of them is data bars. Data bars assign the longest bar to the largest value in a list and the
shortest bar to the smallest value. The values in between are then given bars according to their
respective values. Let us apply this to the Total column.
Select the range of cells under the Total heading. Click on the Conditional Formatting button and
navigate to the Data Bars menu. Select the Purple Data Bar button.
Using color scales also gives you a similar result as data bars. Both features allow you to get a quick view
of how your data values compare to one another. The 2-color scales assign one color to the maximum
You can also delete rules by selecting the cells where you would like to clear the rules, then navigating
to the Clear Rules menu under Conditional Formatting. Click on Clear Rules from Selected Cells.
Exercise 2
After you have cleared the data bars rule from the Total column, apply the Green-Yellow-Red color
scale.
Exercise 3
Edit this rule so that the maximum value is shown in a pretty sky blue color.
The final aspect of conditional formatting we will cover is icon sets. When using icon sets, each cell is
provided with an icon depending on its value. There are no gradients in icon sets.
Let us format the Rate column using icon sets. Select the cells in the Rate column and apply the 3 traffic
lights (rimmed) formatting to them, as shown below.
If you want to change the way that the icons are assigned, you need to edit the rule (Manage Rules). As
you can see below, Excel is currently assigning the Green icon to values >= the 67 percent. What this
What you need to understand about this is that percentages are calculated relative to the lowest and
highest values when percentiles are calculated based on the position of a value in the ordered list of
values.
Exercise 4
Format the OT Rate column using the 3 flags icon style. The cells should show a RED flag if its value is
>=20, a YELLOW flag if its value is <20 and >=15, and GREEN otherwise.
Let us try sorting our table by the ascending alphabetic order of the names of the employees. Select the
range of names in the table. Then in the Home tab, under the Editing group, select Sort A to Z.
What this message is telling us is that with the current selection, only the names column will be sorted.
The data in the rest of the table will not be sorted. This is why we need to select the “Expand the
selection” radio button. This will allow the entire table to be sorted according the alphabetic order of
the names. Press the Sort button. The entire table has now been sorted.
Excel also lets us perform more complicated sorting. Let us try to sort the table by the cell icons of the
Rate column.
Select the entire table. Under Sort and Filter, select Custom Sort.
This dialog box shows the column headers in our table, how we want to sort them, and what order we
want them in.
Select Rate as the Sort by column, and then select for it to be sorted on Cell Icon. The order menu now
shows the three icons used in the Rate column. Let us ask for the green icon to be placed on top, as
shown below.
Exercise 6
Use custom sort to sort the table in the descending order of the OT Rate and then in ascending order of
the names of the employees.
Filtering lists
Filtering in Excel allows you to show only the rows of data you are concerned with, and hide all other
data temporarily.
One obvious use for filters here is to view the sales information of only a few regions of interest. Let us
see how this can be done.
Start by selecting the Region column. Under the Home tab and in the Editing Group, select the Sort and
Filter button. Select Filter from the menu.
Now, only the rows showing information from either the NE or SE are shown. Notice the button next to
the region header has changed to a filter icon indicating that a filter has been applied.
Now that we can see our original data, let us add a new filter. Select the arrow next to Region and move
the mouse cursor over Text Filters. Choose Ends With.
Now let us remove the filter by clicking on the button next to Region and selecting Clear Filter from
“Region” from the menu.
Exercise 8
Remove the previous filters from the table. Show only the rows from the months April, May, and June
of all the years (2nd quarter). From those rows, only show the ones with Sales above the average.