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

Data Manipulation & Analysis

The document discusses techniques for locating and extracting data from tables in Excel for analysis. It describes how to query tables using AutoFilter to display only records that meet certain criteria. It also explains how to set up a criteria range on a worksheet and use advanced filtering to extract records that meet comparison criteria or display them as a subset of the table. The document provides examples of different types of criteria that can be used, such as blanks to include all records, multiple criteria using AND/OR, and criteria on the same field requiring duplicate column headers. Steps are outlined for creating criteria and extract ranges to manipulate records based on given conditions.

Uploaded by

Mariam Fuad
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Data Manipulation & Analysis

The document discusses techniques for locating and extracting data from tables in Excel for analysis. It describes how to query tables using AutoFilter to display only records that meet certain criteria. It also explains how to set up a criteria range on a worksheet and use advanced filtering to extract records that meet comparison criteria or display them as a subset of the table. The document provides examples of different types of criteria that can be used, such as blanks to include all records, multiple criteria using AND/OR, and criteria on the same field requiring duplicate column headers. Steps are outlined for creating criteria and extract ranges to manipulate records based on given conditions.

Uploaded by

Mariam Fuad
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Unit 2

Data
Manipulation
& Analysis
Data Selection:
Locate & Extract Data
for Analysis
Guideline
• Locate & Extract Data for Analysis

22
Data Location & Extraction

• Obtain answers to questions about the data in the table using


a variety of methods to query the table.

• A query can include filters, the use of which results in the


table displaying only those records that meet certain criteria.

• Or, a query can include a calculation based on data in the


table that then is displayed outside of the table but within the
same worksheet.

33
Data Location & Extraction
• Extract records from the table based on given criteria. A criteria
area and extract area can be created on the worksheet.

• The criteria area can be used to enter rules regarding which


records to extract, such as all full-time employees with a hours
worked greater than 8. The extract area can be used to store the
records that meet the criteria.

• The column headings from the table should be used as column


headings in both the criteria and extract areas of the worksheet,
as this is required by Excel when working with criteria and extract
areas.
44
Data Location & Extraction
• Recall that when you first create a table, Excel automatically
enables AutoFilter; the column heading arrows thus appear to
the right of the column headings.

• You can hide the arrows so that they do not show by toggling
the Filter button (Data tab | Sort & Filter group) or the Filter
command on the Sort & Filter menu (Home tab | Editing group).

• Clicking an arrow reveals the AutoFilter menu for the column


heading. The query technique that uses the column heading
arrows is called AutoFilter query.

55
Data Location & Extraction

• AutoFilter displays all records that meet the criteria as a subset of the
table by hiding records that do not pass the test. The AutoFilter menu
allows you to search for items in the column by typing in a Search box
that appears above the list of items.

• Clicking a column heading arrow causes Excel to display commands and


a list of all the items in the field (column) in an AutoFilter menu, which
are all preselected.

• If you deselect an item from the AutoFilter menu, Excel immediately


hides records that contain the item. The item you deselect from the
AutoFilter menu is called the filter criterion.
66
In-class Exercise

• Open the document inClassEx-Data Extract Draft (Filter (1))


and query the table to display the records of those employees
that have an hourly wage over 8 and their names begin with
“M” or “G”, using the AutoFilter technique.

77
Data Location & Extraction
In custom filtering:
• You can click the And option button or the Or option button to
select the AND operator or the OR operator. The AND operator
indicates that both parts of the criteria must be true; the OR
operator indicates that only one of the two must be true.

• Use the AND operator when the custom criteria is continuous


over a range of values, such as (3 ≤ Experience ≤ 5). Use the OR
operator when the custom criteria is not continuous, such as
Experience less than or equal to 3 OR greater than or equal to 5
(3 ≥ Experience ≥ 5).

88
Data Location & Extraction
Advanced Filtering
Using a Criteria Range on the Worksheet

• You can set up a criteria range on the worksheet and use it to


manipulate records that pass the comparison criteria. Using a
criteria range on the worksheet involves two steps:
1. Create the criteria range and name it Criteria.
2. Use the Advanced button on the Data tab.

99
Data Location & Extraction

1. Create the criteria range and name it Criteria:

To set up a criteria range:


• First copy the column headings in the table to another area of the
worksheet. If possible, copy the column headings to rows above the table.
• Next, enter the comparison criteria in the row immediately below the
field names you just copied to the criteria range.
• Then use the Name box in the formula bar to name the criteria range,
Criteria.

10
10
Data Location & Extraction

1. Create the criteria range and name it Criteria:

11
11
Data Location & Extraction

2. Use the Advanced button on the Data tab.

• Using the Advanced Filter dialog box is similar to using the


AutoFilter query technique, except that it does not filter
records based on comparison criteria you select from a table.
Instead, this technique uses the comparison criteria set up in
a criteria range on the worksheet.

12
12
Data Location & Extraction

2. Use the Advanced button on the Data tab.

Steps:
• Click a cell to activate the (original) table.
• Display the Data tab and then click the Advanced button
(Data tab | Sort & Filter group) to display the Advanced Filter
dialog box.

13
13
Data Location & Extraction
• Click the OK button (Advanced Filter dialog box) to hide all
records that do not meet the comparison criteria

14
14
In-class Exercise

• Display the records of those employees that are full-time and


work over 8 hours per week, using criteria range in sheet 2.
Final result should look like this:

• Remove this filter after you do it in order to move to the next.


15
15
Data Location & Extraction

Extract records from the table based on given criteria.

• Extracting records allows you to pull data from a table so that


you can analyze or manipulate the data further. For example,
you may want to know which customers are slacking with their
payments. Extracting records that meet this criterion allows you
to then use the records to create a mailing to such customers.

16
16
Data Location & Extraction

Extract records from the table based on given criteria.

• If you select the ‘Copy to another location’ option button in the


Action area of the Advanced Filter dialog box, Excel copies the
records that meet the comparison criteria in the criteria range to
another part of the worksheet, rather than displaying them as a
subset of the table. The location to where the records are copied
is called the extract range.

17
17
Data Location & Extraction
Extract records from the table based on given criteria.
Creating an extract range requires steps similar to those used to
create a criteria range earlier. Steps:
• To create an extract range, copy the field names of the table and
then paste them to an area on the worksheet, preferably well
below the table range.
• Next, name the pasted range Extract by using the Name box in
the formula bar.
• Finally, use the Advanced Filter dialog box to extract the records.

18
18
Data Location & Extraction
Extract records from the table based on given criteria.
Repeat the previous exercise with extract

19
19
Data Location & Extraction

More about the Criteria Range


• The comparison criteria in the criteria range determine the
records that will pass the test when the Advanced Filter
dialog box is used. Next, we’ll describe examples of different
comparison criteria.

20
20
Data Location & Extraction

More about the Criteria Range

• If the criteria range contains a blank row, it means that no


comparison criteria have been defined. Thus, all records in
the table pass the test.
• If the criteria range contains two or more entries below the
same field name, then records that pass either comparison
criterion pass the test. This is called Multiple Criteria.

21
21
Data Location & Extraction

More about the Criteria Range


• If an AND operator applies to the same field name (Hourly Wage >
8 AND Hourly Wage < 10), then you must duplicate the field name
(Hourly Wage) in the criteria range. This is also Multiple Criteria.
• Then adjust the range assigned to the name Criteria by using the
Define Name command (Formulas tab | Defined Name group) or
use the Name Manager command to edit the selected range.

22
22
Data Location & Extraction

More about the Criteria Range


Comparison Criteria in Different Rows and Below Different Fields
• When the comparison criteria below different field names are in the
same row, then records pass the test only if they pass all the
comparison criteria. If the comparison criteria for the field names are
in different rows, then the records must pass only one of the tests.

23
23
In-class Exercise

• Display the records of those employees that are full-time and


work between 8-10 hours per week, using criteria range. Final
result should look like this:

24
24
Data Location & Extraction

Data Extraction with Database functions

• Excel includes 12 database functions that allow you to evaluate numeric


data in a table. One of the functions is called the DAVERAGE function.
As the name implies, the DAVERAGE function is used to find the average
of numbers in a table field that pass a test.
• The general form of the DAVERAGE function is:
=DAVERAGE(table range, “field name”, criteria range)
• where table range is the range of the table, field name is the name
of the field in the table, and criteria range is the comparison
criteria or test to pass.
25
25
Data Location & Extraction

Data Extraction with Database functions

• The following steps use the DAVERAGE function to find the


average Hourly wage of full-time employees and the average
Hourly wage of part-time employees in the table.

26
26
Data Location & Extraction

Data Extraction with Database functions

• merge cells G7 and H7 and then type Criteria to enter a


criteria area title.
• Select cell G8 and then type Status to enter a field name.
Select cell H8 and, again, type Status to enter a field name.
• Enter Full-time in cell G9 as the Type code for full-time
employees. Enter Part-time in cell H9 as the Type code for
part-time employees.

27
27
Data Location & Extraction

Data Extraction with Database functions

• Enter Avg Full-time wage in cell G11. Enter Avg Part-time wage
in cell G12.
• Select cell H11 and then type =DAVERAGE(A6:E11, "Hourly
Wage", G8:G9) to enter a database function.
• Select cell H12 and then type =DAVERAGE(A6:E11, "Hourly
Wage", H8:H9) to enter a database function.

28
28
Data Location & Extraction

Data Extraction with Database functions

29
29
Data Location & Extraction
Using Wildcards in Criteria
• The * wildcard
• The asterisk (*) wildcard character represents any number of
characters in that position, including zero characters.
• In this example, any customer whose name contains "mart"
will pass through the Excel advanced filter.

30
30
Data Location & Extraction
Using Wildcards in Criteria
• The ? wildcard
• The question mark (?) wildcard character represents one
characters in that position.
• In this example any 4-letter product that begins with c, and
ends with ke, will pass through the Excel advanced filter. Both
Coke and Cake are in the filtered results.

31
31

You might also like