0% found this document useful (0 votes)
22 views

Excel Chapter - 8

The document discusses how to sort and filter data in Microsoft Excel. It describes how to sort data by one or multiple columns in ascending or descending order. It also explains how to filter data to display only records that meet specified criteria, such as filtering by text, numbers, dates, or using a custom autofilter. The document provides step-by-step instructions and tips for each technique.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Excel Chapter - 8

The document discusses how to sort and filter data in Microsoft Excel. It describes how to sort data by one or multiple columns in ascending or descending order. It also explains how to filter data to display only records that meet specified criteria, such as filtering by text, numbers, dates, or using a custom autofilter. The document provides step-by-step instructions and tips for each technique.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

PM2 - Management Reporting – IT Office Tools (MS Excel)

Chapter – 8
Working with Lists:
Sort Data:
Sorting by One Column:
In Excel it’s possible to take ranges of data and sort them into different orders.

Before sorting data, make sure it’s organized into two components:

• Fields (columns): Records are broken up into fields which store specific pieces of
information, such as first and last name.

• Records (rows): Each record contains information about a unique thing or person, just
like a listing in a phone book.

Once the data is organized in columns and rows, sort by values in a certain column.

Trap: If data has column headings, don’t select them when sorting, or they’ll be sorted
along with other data—unless the Sort & Filter button is first clicked in the Editing group

on the Home tab; select Custom Sort, and check the My data has headers box.
1. Select a range of data or select a cell in the column.

Trap: If a column of data is selected with more data next to it, the Sort Warning dialog
box appears, asking to expand the selection. Normally, do this; otherwise, the column of
data selected will be sorted independently of the surrounding data.

2. Click the Home tab on the Ribbon and click the Sort & Filter button in the Editing
group.

A list of sorting options appears which change according to the type of data being sorted:

• Text options: Sort A to Z or Sort Z to A.

• Number options: Sort Smallest to Largest or Sort Largest to Smallest.

• Date options: Sort Oldest to Newest or Sort Newest to Oldest.

3. Select a sort option.


PM2 - Management Reporting – IT Office Tools (MS Excel)

The column is sorted based on the values in the leftmost column in the selected range. All
the fields within each record move together. For example, if a list of first and last names is
sorted by last name, the first names still correspond to the last names after sorting.

Other Ways to Sort:


Select the entire range or select a cell in the column to sort by. Click the Data tab on the
Ribbon and click one of the sort buttons in the Sort & Filter group. Or, right-click a cell in a
column that

Tips:

 To sort by rows instead of columns, click the Sort & Filter button in the Editing group on
the Home tab, select Custom Sort, click Options in the Sort dialog box and select Sort

left to right.
Sorting by Colors or Icons:
To sort by cell colors, font colors, or by icons, use a custom sort.

1. Select the range of data or a cell within the range.

The data should contain cell or font color formatting or icons created with conditional
formatting.

2. Click the Home tab on the Ribbon and click the Sort & Filter button in the Editing
group.

3. Select Custom Sort.

The Sort dialog box appears. First select which column to sort by.

Tip: If the range being sorted includes headers, select My data has headers option so
that the headers aren’t sorted with the rest of the data.

4. Click the Sort by list arrow and select the column to sort by.

Next specify the type of sort.

5. Click the Sort On list arrow and select the type of sort to use.
PM2 - Management Reporting – IT Office Tools (MS Excel)

Tip: Define the sort order for cell colors, font colors, or icons. Excel does not have a
default order like it does for values.

6. Click the first list arrow in the Order column and select a cell or font color, or icon.

Now tell Excel where to put the color or icon selected. Select: On Top or On Bottom to
move it to the top of bottom of the column sort. If sorting by rows, select from On Left or
On Right.

7. Click the second list arrow in the Order column and select the option to use.

Tip: The data will be sorted with the color or icon selected placed on top or bottom as
specified. Specify additional colors or icons by adding additional levels to the sort.

Tip: Click Add Level button in the Sort dialog box to add a sort level. Click the Delete
Level button to delete the selected sort level to stop its use.

Click OK.

Sorting by Multiple Columns:


To sort by more than one column, use a custom sort.

1. Select a range of cells with at least two columns of data or select a cell within the range.

2. Click the Home tab on the Ribbon and click the Sort & Filter button in the Editing

group.

3. Select Custom Sort.

The Sort dialog box appears.

4. Click the Sort by list arrow and select the first column to sort by.

5. Click the Sort On list arrow and select the type of sort to use.

6. Click the Order list arrow(s) and select the option(s) to use.

To sort by multiple columns, use more sort levels.

7. Click Add Level.


PM2 - Management Reporting – IT Office Tools (MS Excel)

Excel will sort the data by each level in order.

8. Repeat the sorting steps for the next level, selecting the next column to sort by, and add
more levels. Excel will sort the data by each level in order.

Tip: Click the Delete Level button to delete a sort level to stop its use.

Click OK.

Sorting by a Custom List:


A custom list allows criteria to be sorted by a specified definition or by one of Excel’s
predefined custom lists.

Create a custom list:

First let’s look at how to create a custom list.

1. Enter the values to sort by, in the correct order from top to bottom, in a column of cells.

2. Select the values just entered.

Now create the list.

3. Click the File tab on the Ribbon and select Options from the list.

The Excel Options dialog box appears.

4. Click the Advanced tab, scroll down and in the General section, and click the Edit

Custom Lists button.

The Custom Lists dialog box appears. See the custom lists that are already stored in Excel.

5. Select the cells to use in the Import list from cells section in the Custom Lists dialog box.
Click the Import button.

6. Click OK.

The Custom Lists dialog box closes.

7. Click OK.

The Excel Options dialog box closes and the custom list is created.
PM2 - Management Reporting – IT Office Tools (MS Excel)

Tip:

 It’s only possible to create a custom list based on a value, not on cell color, font color, or
an icon.

Sort by a custom list:


Once a list is created, or if using one of Excel’s predefined custom lists, the data is ready to
sort.

1. Select the range of data to sort or select a cell within the range.

2. Click the Home tab on the Ribbon, click the Sort & Filter button in the Editing group,

and select Custom Sort.

The Sort dialog box appears.


3. Click the Sort by list arrow and select a column to sort by (the column with data that

matches the custom list).

4. Click the Order list arrow and select Custom List.

5. Select the custom list to use and click OK.

6. Click OK.

The data is sorted according to the custom list.

Tip:

 To sort by rows instead of columns, click Options in the Sort dialog box and select Sort
left to right.

Filter Data:
When filtering data, Excel displays only the records that meet the criteria specified—other
records are hidden.
PM2 - Management Reporting – IT Office Tools (MS Excel)

Filter text, numbers and dates:

Filter by values such as text, numbers, or dates.


1. Select the range of data to filter or select a cell within the range.

2. Click the Home tab on the Ribbon, click the Sort & Filter button in the Editing group,

and click Filter.

Filter buttons that look like arrows appear in the first cell of each field header.

Other Ways to Filter:


Click the Data tab on the Ribbon and click the Filter button in the Sort & Filter group.

3. Click the filter button for the column to filter.

4. Click the check boxes of values to display.

Other Ways to Select Filter Criteria: Click the Search box in the filter list and type
the criteria by which to filter. The list displays criteria that match the search.

Keep filtering by additional columns:

5. (Optional) Click another column’s filter button and apply more filter criteria.

6. Click OK.

The data is further reduced.

Remove filtering:

Remove a filter to once again display all the data.

1. Click the Home tab on the Ribbon, click the Sort & Filter button in the Editing group,
and select Filter.

The filter buttons disappear and filtering is removed.

Creating a Custom AutoFilter:


Excel offers some predefined filter criteria that can be accessed using a Custom AutoFilter.
This lesson explains how to filter data using Custom AutoFilter.
PM2 - Management Reporting – IT Office Tools (MS Excel)

1. Select a range of cells to filter plus the column header row (or a blank row, if there isn’t a
header).

2. Click the Home tab on the Ribbon, click the Sort & Filter button in the Editing group,

and click Filter.

Filter buttons appear in the first cell of each column in the range.

3. Click the filter button in the column to filter.

List of options appears. Depending on whether the selected cells contain text, numbers, or
dates, the options will differ.

4. Point to the option that appears in the list: Text Filters, Number Filters, or Date

Filters.

List of comparison operators, such as Equals, appears, as well as the Custom Filter option.

5. Select Custom Filter.

The Custom AutoFilter dialog box appears.

Tip: If working with numbers or dates and a comparison operator such as Above Average
is selected (instead of selecting Custom Filter), the Custom AutoFilter dialog box won’t
appear—the data will simply be filtered.
6. Click the first list arrow and select a comparison operator.

7. Click the second list arrow in the first row and select a value from the list or enter a value
in the text box.

8. (Optional) Select And or Or and select a second criteria to filter the column by.

Tip: Use wildcards when entering values in the Custom AutoFilter dialog box. Use a ‘?’ to
represent any single character or a ‘*’ to represent a series of characters.

9. Click OK.

The Custom AutoFilter dialog box closes and the data is filtered.
PM2 - Management Reporting – IT Office Tools (MS Excel)

Using an Advanced Filter:


Advanced filtering is the most powerful and flexible way to filter Excel data. It’s also the
most difficult method, and requires more work to set up and use. With an Advanced Filter,
it’s possible to:

• Filter using criteria located outside of the data range.

• Use wildcards in the filter criteria.

• Extract and copy filtered results to another range on the worksheet.

To create an Advanced Filter, start by defining a criteria range. A criteria range is a cell
range located outside of the data range that contains the filter criteria.
1. Copy the desired column labels from the data range and paste them in the first row of the
criteria range.
For example, to filter for sales reps with sales greater than $20,000 and who are also
managers, copy the Sales and Position column labels to the criteria range.

Tip: The criteria range can be any area of open cells on the worksheet and only copy the
labels for the columns that contain criteria to be filtering on.

2. In the rows below the criteria labels, type the criteria to filter for.

In the above example, type >20000 under the Sales label and Manager under the Position
label.

Tip: Enter values or text to filter for, and incorporate operators such as < or > to specify
the records to filter for. Use wildcards—for example, enter *r to filter out text that doesn’t
end with the letter “r”.

3. Click the Data tab on the Ribbon and click the Advanced button in the Sort & Filter
group.

The Advanced Filter dialog box appears. Specify the range of data to filter, as well as the
criteria to filter by.

4. Make sure the Filter the list, in-place option is selected in the Action area.

That way, the filtered results will be displayed right in the original data range.
PM2 - Management Reporting – IT Office Tools (MS Excel)

5. Tip: To copy filtered results to another location on the worksheet, first prepare an extract
range with labels for the fields to display. The extracted fields needn’t be the same fields
that are used in the criteria range. For example, set the filter to only show certain records,
and then extract only the names of records that match those criteria. Select Click the List

range collapse dialog button and select the data range to filter. Press the <Enter>
key.

6. Click the Criteria range collapse dialog button and select the criteria range, including

the column labels. Press the <Enter> key.

7. Click OK.

The data is filtered based on the criteria in the criteria range, and the results are displayed
in the data range.

Tip: To remove the advanced filtering, click the


Clear button in the Sort & Filter group on the Data tab.

Comparison Operators and Wildcards

= Equal to
<> Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
* Wildcard--any number of characters in the same position as the asterisk
Example: “*east” finds "Northeast" and "Southeast"
? Any single character in the same position as the question mark
Example: sm?th finds "smith" and "smyth"

Query Data with Database Functions:


Database functions allow you to search for and perform operations on data in a table or
list, according to conditions that you specify. Some useful database functions are:
PM2 - Management Reporting – IT Office Tools (MS Excel)

DAVERAGE Averages values in a column according to conditions you specify.


DCOUNT Count cells that contain numbers matching conditions you specify.
DGET Gets a record from an Excel database matching conditions that you
specify.
DMAX Gets the largest number from a column in your Excel database where
the number satisfies conditions you specify.
DMIN Retrieves the smallest number that meets your conditions from a
column in the database.

DSUM Sums numbers in a database that satisfy conditions you specify.

Outline and Subtotal Data:


Many spreadsheets are created in a hierarchical style. For example, a worksheet might
contain a column for each month, followed by a total column. By outlining worksheets,
they’re easier to understand and read. Instead of sifting through irrelevant information,
collapse an outline to display each group’s bottom line. There are several ways to outline a
workbook.

• Using the Auto Outline Feature: The Auto Outline command automatically outlines a
selected range of cells or the entire worksheet, based on formulas and the direction of
references.

• Grouping Data: Group rows and columns manually by selecting them.

• Using the Subtotals Feature: The Subtotals command calculates subtotal values for
the labeled columns selected. Excel automatically inserts and labels the total rows and
outlines the list.

• Using the Consolidate Feature: Consolidate several sheets using the Consolidate
feature.

This lesson explains how to use the Auto Outline feature and how to group data manually.

Group rows or columns manually:

1. Select the column or row data to group.

2. Click the Data tab on the Ribbon and click the Group button in the Outline group.
PM2 - Management Reporting – IT Office Tools (MS Excel)

The Group dialog box appears. Select whether to group rows or columns.

3. Select the Rows or Columns option and click OK.

The selected rows or columns are grouped together.

Hide or show detail:


Once data is grouped or outlined, collapse or expand the group detail.

1. Click the Data tab on the Ribbon and click the Hide Detail or Show Detail button in
the Outline group.

Other Ways to Hide or Show Detail: Click the outline symbols next to or above
the worksheet. These include the Row Level and Column Level buttons and the

plus and minus button.

Ungroup rows or columns:

1. Select the grouped row or column data.

2. Click the Data tab on the Ribbon and click the Ungroup button in the Outline group.

Outline data automatically:


If the data contains detailed rows or columns that are summed or subtotaled, Excel can
automatically group the data into outline form.

Tips:

Excel will only outline numerical data that is related by a sum or subtotal formula. It
cannot outline text data or numerical data that is not totaled by a formula.

1. Make sure data has column labels and contains formulas that summarize the data.

The sum and subtotal functions are commonly used to summarize rows or columns.

Tip: Summary rows and columns should be below and to the right of the data,
respectively. If they are above or to the left, click the Outline Dialog Box Launcher in the
PM2 - Management Reporting – IT Office Tools (MS Excel)

Outline group. Remove the checkmark from the Summary rows below detail or

Summary columns to right of detail check box.

2. Select a cell in the data range to outline.

3. Click the Data tab on the Ribbon, click the Group button list arrow in the Outline group,

and select Auto Outline.

The data is automatically outlined so that the detailed rows or columns can be collapsed
and only the totals or subtotals can be viewed.

Remove an outline:

1. Click the Data tab on the Ribbon, click the Ungroup button list arrow in the Outline

group, and select Clear Outline.

The outline is cleared from the worksheet.

Using Subtotals:
A quick and easy way to group and summarize data is to use Excel’s Subtotals feature.
Usually, subtotals are created with the Sum function, but subtotals can also be created
using functions such as Count, Average, Max, and Min. The Subtotals feature also outlines
the data, displaying and hiding the detail rows for each subtotal.

Create subtotals:

1. Make sure data is arranged into labeled columns, that the data in each column is of the
same type, and that data sorted based on the column to group the subtotals by.

Now Excel is ready to subtotal the data.

Tip: Excel’s Subtotals feature subtotals data by automatically inserting the Subtotal
function.

2. Select a cell in the data range.

3. Click the Data tab on the Ribbon and click the Subtotal button in the Outline group.
PM2 - Management Reporting – IT Office Tools (MS Excel)

The Subtotal dialog box appears.

4. Click the At each change in list arrow and select the column to subtotal.

This command specifies what to subtotal. For example, to subtotal a list of customers, the
products they bought, and the amounts of the sales, subtotal the list by the type of
product; to get the subtotal, select the column that contains the products.

5. Click the Use function list arrow and select the function to use to calculate the subtotals.
For example, select Sum, Count, Average, or Max.

6. In the “Add subtotal to” box, click the check box next to each column that has values to
subtotal.

7. Click OK.

The data is organized with subtotals.

Tips:

 To hide or show subtotals detail, click the Hide Detail and Show Detail buttons in the

Outline group on the Ribbon or use the outline symbols next to the worksheet to hide or
display individual subtotals.

To add more subtotals, repeat the steps but uncheck the Replace current

subtotals check box so that the existing subtotals are not overwritten.

Remove subtotals:

1. Click the Data tab on the Ribbon and click the Subtotal button in the
Outline group.

The Subtotal dialog box appears.

2. Click the Remove All button.

The subtotals are removed.

You might also like