SlideShare a Scribd company logo
Slide - 1
Business Analytics: Methods, Models,
and Decisions
Third Edition, Global Edition
Chapter 2
Database Analytics
Copyright © 2021 Pearson Education Ltd.
Copyright © 2021 Pearson Education Ltd. Slide - 2
Data Sets and Databases
• Data set - a collection of data
– Examples: Marketing survey responses, a table of
historical stock prices, and a collection of measurements
of dimensions of a manufactured item
• Database - a collection of related files containing
records on people, places, or things
– A database file is usually organized in a two-
dimensional table, where the columns correspond to
each individual element of data (called fields, or
attributes), and the rows represent records of related
data elements.
Copyright © 2021 Pearson Education Ltd. Slide - 3
Example 2.1: A Purchase Order
Database
• Each row represents a record.
• Each column represents a field or attribute.
Copyright © 2021 Pearson Education Ltd. Slide - 4
Example 2.2: Using Range Names for
a Database
• Define the range
name for each row
of data as the
month, and the
name for each
column of data by
the product.
Example: The range name for B4:F4 is January; the range
name for B4:B15 is Product_A.
To find the annual sales of Product A, use the Excel
formula =SUM(Product_A).
Copyright © 2021 Pearson Education Ltd. Slide - 5
Data Queries: Tables
• An Excel table allows you to use table references to
perform basic calculations. Select the data range
including headers. Next, click Table from the Tables
group on the Insert tab and make sure that the box
for My Table Has Headers is checked.
• The table name (default: Table1),can be found (and
changed) in the Properties group of the Table Tools
Design tab in Windows or in the Table tab on a Mac.
Copyright © 2021 Pearson Education Ltd. Slide - 6
Example 2.3: Excel Table for Credit
Risk Data
Copyright © 2021 Pearson Education Ltd. Slide - 7
Example 2.4: Table-Based
Calculations
• To sum the data in column C, use the function
=SUM(Table1[Savings]).
• To find the number of home owners use the function
=COUNTIF(Table1[Housing], “Own”).
• If we add new records to the table, the calculation will be
updated automatically.
Copyright © 2021 Pearson Education Ltd. Slide - 8
• Select a cell (but not the header) in the column
for sorting.
– Use the AZ or ZA buttons on the Data tab to
sort from low to high or high to low.
• Click the Sort button for advanced sorting.
Data Queries: Sorting Data
3-8
Copyright © 2021 Pearson Education Ltd. Slide - 9
• Sort data by supplier.
Example 2.5: Sorting Data in the
Purchase Orders Database
Copyright © 2021 Pearson Education Ltd. Slide - 10
 An Italian economist, Vilfredo Pareto, observed in
1906 that a large proportion of the wealth in Italy
was owned by a small proportion of the people.
 Similarly, businesses often find that a large
proportion of sales come from a small proportion
of customers, the “80-20 rule.”
 A Pareto analysis involves sorting data and
calculating cumulative proportions.
3-10
Pareto Analysis
Copyright © 2021 Pearson Education Ltd. Slide - 11
• In the Bicycle Inventory database, compute the inventory value of
each product by multiplying the quantity on hand by the purchase
cost. Sort the data in decreasing order of inventory value and
compute the percentage of the total inventory value for each product
and the cumulative percentage.
Example 2.6: Applying the Pareto
Principle
Copyright © 2021 Pearson Education Ltd. Slide - 12
• Filtering is finding a subset of records that meet
certain characteristics.
• Excel provides two filtering tools:
– AutoFilter for simple criteria
– Advanced Filter for more complex criteria.
Data Queries: Filtering Data
3-12
Copyright © 2021 Pearson Education Ltd. Slide - 13
• First, select any
cell within the
database. Then,
from the Data
tab, click Filter.
Click on cell D3
dropdown arrow.
Select only Bolt-
nut package.
3-13
Example 2.7: Filtering Purchase
Order Records by Item Description
Copyright © 2021 Pearson Education Ltd. Slide - 14
• The Filter tool will display only those orders for
this item.
• To restore the original data file, click on the drop-
down arrow again and then click Clear filter from
“Item Description.”
Example 2.7 Continued
Copyright © 2021 Pearson Education Ltd. Slide - 15
• Identify all records in
the Purchase Orders
database whose item
cost is at least $200.
• Click on the drop-down
arrow in the Item Cost
column and position the
cursor over Numbers
Filter. Select Greater
Than Or Equal To . . .
from the list.
Example 2.8: Filtering Records by
Item Cost
Copyright © 2021 Pearson Education Ltd. Slide - 16
• This brings up a Custom AutoFilter dialog that allows
you to specify up to two specific criteria using “and”
and “or” logic. (The Mac version does not have these
and/or options.) Enter 200 in the box and then click
OK.
Example 2.8 Continued
Copyright © 2021 Pearson Education Ltd. Slide - 17
• The Filter tool does not extract the records; it simply
hides the records that don’t match the criteria.
– This means that if you highlight a range of filtered
data to compute a sum or average, for example,
you will get the results for all records, including
those that are hidden from view.
– You can copy and paste the filtered data to
another range or Excel worksheet, which then
uses only the filtered records, and get the correct
results.
Caution!
Copyright © 2021 Pearson Education Ltd. Slide - 18
• The Advanced Filter provides a way of explicitly
defining criteria by which to filter a database.
• First, copy the headers from the database to an
open location in the worksheet. Under the
headers, specify the criteria that you want to use
to filter the data.
– Multiple criteria in the same row are logically
joined by “and,” while criteria in rows are
joined by “or.”
Advanced Filter
Copyright © 2021 Pearson Education Ltd. Slide - 19
• For the Purchase Orders database, we will find
all the records for Hulkey Fasteners having order
quantities that exceed 5,000 and order dates
before 9/1/11, as well as all records for Steelpin
Inc. with order quantities less than 5,000 and
order dates before 9/1/11.
Example 2.9: Using the Advanced
Filter
Copyright © 2021 Pearson Education Ltd. Slide - 20
• Choose Advanced next to the Filter in the Data
tab. In the dialog box, enter the list range of the
database and the criteria range.
Example 2.9 Continued
Copyright © 2021 Pearson Education Ltd. Slide - 21
• Results
– Note that only the records meeting the criteria
are displayed.
Example 2.9 Continued
Copyright © 2021 Pearson Education Ltd. Slide - 22
• Database functions start with a “D” (for example,
DSUM, DAVERAGE, DCOUNT) and allow you to specify
criteria that limit the calculations to a subset of
records using the same format as the Advanced Filter.
• For example, the syntax for the DSUM function is
DSUM(database, field, criteria). Database is the range
that includes the column labels; field is the column name
that contains the values to sum, enclosed in quotation
marks, or a reference to the column name; and criteria is
the range that specifies the records you want to sum.
Database Functions
Copyright © 2021 Pearson Education Ltd. Slide - 23
• In the Purchase Orders database, find the total
cost of all orders that meet the criteria specified
in Example 2.9:
• Alternatively, we could have used the function
=DSUM(A8:J102,“Cost per order”, A3:J5).
Example 2.10: Using a Database
Function
Copyright © 2021 Pearson Education Ltd. Slide - 24
Logical Functions
• =IF(condition, value if true, value if false) – returns
one value if the condition is true and another if the
condition is false,
• – returns TRUE
if all conditions are true and FALSE if not,
• – returns TRUE if
any condition is true and FALSE if not.
Copyright © 2021 Pearson Education Ltd. Slide - 25
IF Function
• =IF(condition, value if true, value if false)
• Conditions may include the following:
Copyright © 2021 Pearson Education Ltd. Slide - 26
Example 2.11: Using the IF Function
• Suppose that orders with quantities of at least
10,000 units are classified as Large.
– Cell K4:
• Suppose that large orders with a total cost of at
least $25,000 are considered critical.
– Cell L4:
Copyright © 2021 Pearson Education Ltd. Slide - 27
Nesting IF Functions
• You may “nest” up to seven IF functions by
replacing value if true or value if false in an IF
function with another IF function:
=IF(A8= 2,(IF(B3= 5, “YES”, “”)),15)
Copyright © 2021 Pearson Education Ltd. Slide - 28
Example 2.12: Calculating the Price
of Quantity Discounts
• For quantities of 1,000 or less, the unit price is
$10; for quantities of 1,001 to 5,000, the unit
price is $9.00; and for quantities that exceed
5,000, the unit price is $7.50.
– IF(Q = 1,000, Q*10, value if false)
– IF(Q = 1,000, Q*10, IF(Q6 <= 5,000, Q*9,
value if false))
– IF(Q = 1,000, Q*10, IF(Q6 <= 5,000, Q*9,
Q*7.5))
Copyright © 2021 Pearson Education Ltd. Slide - 29
Lookup Functions for Database
Queries
•
- looks up a value in the leftmost column of a table and returns a
value in the same row from a column you specify
•
- looks up a value in the top row of a table and returns a value in
the same column from a row you specify.
• - returns a value or reference of the
cell at the intersection of a particular row and column in a given range.
• - returns the relative
position of an item in an array that matches a specified value in a
specified order.
=CHOOSE(index_num, value1, value2, . . . ) - returns a value from
a list based on the position in the list, specified by index_num .
•
Copyright © 2021 Pearson Education Ltd. Slide - 30
Important Notes on Lookup
Functions
• In the VLOOKUP and HLOOKUP functions, range lookup is
optional. If this is omitted or set as True, then the first column of
the table must be sorted in ascending numerical order.
• If an exact match for the is found in the first
column, then Excel will return the value of
of that row. If an exact match is not found, Excel will choose the
row with the largest value in the first column that is less than the
• If range lookup is False, then Excel seeks an exact match in the
first column of the table range. If no exact match is found, Excel
will return #N/A (not available).
Specify the range lookup to avoid errors!
Copyright © 2021 Pearson Education Ltd. Slide - 31
Example 2.13: Using the VLOOKUP
Function
returns the payment type Credit.
returns the transaction
code 80103311
Copyright © 2021 Pearson Education Ltd. Slide - 32
INDEX Function
•
• The INDEX function returns the value in a particular row
and column of an array.
• would retrieve the
transaction code 80103311, which is in the 7th row and 4th
column of the database.
Copyright © 2021 Pearson Education Ltd. Slide - 33
MATCH Function
•
• In the MATCH function, is value that you want to
match in which is the range of cells being searched.
The is either −1, 0, or 1. The default is 1.
• If then the function finds the largest value that is
less than or equal to
– The values in the must be placed in ascending order
• If MATCH finds the first value that is exactly equal to
– The values in the can be in any order.
• If then the function finds the smallest value that is
– The values in the must be placed in descending order.
greater than or equal to lookup_value
Copyright © 2021 Pearson Education Ltd. Slide - 34
Example 2.14: Using INDEX and MATCH
Functions for Database Queries
Suppose we wish to design a simple query application to
input the month and product name, and retrieve the
corresponding sales. The three additional worksheets in
the workbook show how to do this in three different ways.
Copyright © 2021 Pearson Education Ltd. Slide - 35
Example 2.14 Continued:
Using VLOOKUP + If
The Query1 worksheet uses the VLOOKUP function with
embedded IF statements. The formulas in cell I8 is:
Copyright © 2021 Pearson Education Ltd. Slide - 36
Example 2.14 Continued:
Using VLOOKUP + MATCH
The formula in cell I8 is:
In this case, the MATCH function is used to identify the column in the
table corresponding to the product name in cell I6. Note the use of the
“+1” to shift the relative column number of the product to the correct
column number in the lookup table.
= VLOOKUP (I5,A4:F15,MATCH(I6,B3:F3,0) + 1,FALSE)
Copyright © 2021 Pearson Education Ltd. Slide - 37
Example 2.14 Continued: Using
INDEX + MATCH
The formula in cell I8 is:
= INDEX(A4:F15,MATCH(I5,A4:A15,0),MATCH(I6,A3:F3,0))
The MATCH functions are used as arguments in the INDEX function to
identify the row and column numbers in the table based on the month
and product name. The INDEX function then retrieves the value in the
corresponding row and column.
Copyright © 2021 Pearson Education Ltd. Slide - 38
Example 2.15: Using INDEX and
MATCH for a Left Table Lookup
• In the Sales Transactions database, we wish to
find the customer ID associated with a specific
transaction code.
Copyright © 2021 Pearson Education Ltd. Slide - 39
• Enter the transaction code in cell K2, and display the
customer ID in cell K4.
• Use the following formula in cell K4:
=INDEX(A4:A475,MATCH(K2,D4:D475,0),1)
Example 2.15 Continued
2-39
Copyright © 2021 Pearson Education Ltd. Slide - 40
• User-friendly templates for repetitive database
queries.
• Characteristics:
– ”Clean”
– Well-organized
– Easy to use
Excel Template Design
4-40
Copyright © 2021 Pearson Education Ltd. Slide - 41
Example 2.16: A Tax Bracket
Calculator
• 2016 U.S. federal income tax rates
• Create a template that allows an individual to
enter their filing status and taxable income and
then returns the corresponding tax bracket.
Copyright © 2021 Pearson Education Ltd. Slide - 42
Example 2.16 Continued: Using IF
and VLOOKUP
Copyright © 2021 Pearson Education Ltd. Slide - 43
Example 2.16 Continued: Using
CHOOSE
=CHOOSE($B$9,VLOOKUP($B$10,Lookup!$A$2:$E$8,5),
VLOOKUP($B$10,Lookup!$B$2:$E$8,4),VLOOKUP($B$10,
Lookup!$C$2:$E$8,3),VLOOKUP($B$10,Lookup!$D$2:$E$8,
2))
Copyright © 2021 Pearson Education Ltd. Slide - 44
Data Validation Tools
• Select the cell range for which data
validation will be applied, and then choose
Data Validation from the Data Tools group
on the Data tab in Excel 2016, or select
Validation from the Data menu on the a
Mac.
Copyright © 2021 Pearson Education Ltd. Slide - 45
Example 2.17: Applying Data
Validation
• For the Tax Bracket template, choose cell B9 (filing
status). In the Data Validation dialog, specify that the
value must be a whole number between 1 and 4. You
may customize the Error Alert and Input Message to
prompt the user.
Copyright © 2021 Pearson Education Ltd. Slide - 46
ISNUMBER Function
• This function returns TRUE if the cell or range
contains a number; otherwise, it returns FALSE.
Copyright © 2021 Pearson Education Ltd. Slide - 47
Example 2.18: Using the ISNUMBER
Function for Data Validation
• In the Tax template, use ISNUMBER to ensure that the
taxable income in cell B10 is numeric. In the Data
Validation dialog, choose Custom, and in the Formula
box, enter the formula =ISNUMBER(B10). An error alert
message will pop up if an invalid entry is made.
Copyright © 2021 Pearson Education Ltd. Slide - 48
• Buttons, boxes, and other mechanisms for inputting or
changing data on spreadsheets easily that can be used
to design user-friendly spreadsheets.
– Spin button—a button used to increase or decrease a numerical
value
– Scroll bar—a slider used to change a numerical value
– Check box—a box used to select or deselect a scenario
– Option button—a radio button used to select an option
– List box—a box that provides a list of options
– Combo box—a box that provides an expandable list of options
– Group box—a box that can hold a group of controls
Form Controls
4-48
Copyright © 2021 Pearson Education Ltd. Slide - 49
• Activate the Developer tab on the Excel Ribbon.
Form Controls
4-49
Copyright © 2021 Pearson Education Ltd. Slide - 50
Example 2.19: Using Form Controls
in the Tax Bracket Template
• Insert the form control (spin button for filing status,
and scroll bar for taxable income).
• Right click and complete the Format Control dialog.
Copyright © 2021 Pearson Education Ltd. Slide - 51
Format Control Dialog for Spin
Button
Copyright © 2021 Pearson Education Ltd. Slide - 52
Example 2.20: Using a Combo Box
• Compute the total sales for any month in the
Monthly Product Sales database.
Copyright © 2021 Pearson Education Ltd. Slide - 53
Exploring Data Using PivotTables
• Excel provides a powerful tool for distilling a
complex data set into meaningful information:
PivotTables.
• PivotTables allows you to create custom summaries
and charts of key information in the data.
• PivotTables can be used to quickly create cross-
tabulations and to drill down into a large set of data
in numerous ways.
Copyright © 2021 Pearson Education Ltd. Slide - 54
Example 2.21: Creating a PivotTable
Click inside the Sales Transactions database
The wizard creates a
blank PivotTable as
shown.
Copyright © 2021 Pearson Education Ltd. Slide - 55
PivotTable Field List
Select and drag the
fields to one of the
PivotTable areas:
• Report Filter
• Column Labels
• Row Labels
• Values
Copyright © 2021 Pearson Education Ltd. Slide - 56
Pivot Table for Total Revenue by
Region You may select the range of the
value, right click, and format the
cells as currency to make the
PivotTable more meaningful.
You may also replace the
names in the headers; for
instance, change Row Labels to
Region and Sum of Amount to
Revenue.
Copyright © 2021 Pearson Education Ltd. Slide - 57
Revenue Breakdown by Region and
Product
Copyright © 2021 Pearson Education Ltd. Slide - 58
Alternate PivotTable View of Region
and Product Revenue
Copyright © 2021 Pearson Education Ltd. Slide - 59
PivotTable Customization
• When you drag a field into
the S Values area, the
PivotTable defaults to the
sum of the values in that
field. Click the dropdown
arrow next to Revenue in
the S Values area and
choose Value Field
Settings. Select Count.
Copyright © 2021 Pearson Education Ltd. Slide - 60
PivotTable for Count of Regional
Sales by Product
Copyright © 2021 Pearson Education Ltd. Slide - 61
Percentage Views
• Percent of the grand total, Percent of row total,
Percent of column total, and other options
– In the Value Field Settings dialog, click the tab
Show Values As. Select the option in the
dropdown box. The % of Row Total is shown:
Copyright © 2021 Pearson Education Ltd. Slide - 62
Using the PivotTable Report Filter
• Dragging a field
into the Filters area
in the PivotTable
Field list allows you
to add a third
dimension to your
analysis. Drag
Payment to the
Filters area. Click
the drop down
arrow in cell B1;
choose Credit.
Copyright © 2021 Pearson Education Ltd. Slide - 63
Slicers
Slicers are tools for drilling down to “slice” a
PivotTable and display a subset of data.
• To create a slicer for any of the columns in the
database, click on the PivotTable and choose
Insert Slicer from the Analyze tab in the PivotTable
Tools ribbon in Windows, or from the PivotTable
Analyze tab on a Mac.
Copyright © 2021 Pearson Education Ltd. Slide - 64
Example 2.22: Using Slicers
• For the PivotTable for the revenues by region
and product, insert a slicer for the source of the
transaction. If you click on one of the Source
buttons, Email or Web, the PivotTable reflects
only those records corresponding to that source.

More Related Content

PPTX
Advanced Filter Concepts in MS-Excel
PPTX
01-01-Data Use Training (Excel sheet).pptx
PPTX
Microsoft excel training
PPTX
Analytics on Spreadsheets-converted.pptx
PDF
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
PPTX
Ms excel 2016 Advance Learning
PPS
Excel Tips
PPT
Excel tips 172
Advanced Filter Concepts in MS-Excel
01-01-Data Use Training (Excel sheet).pptx
Microsoft excel training
Analytics on Spreadsheets-converted.pptx
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
Ms excel 2016 Advance Learning
Excel Tips
Excel tips 172

Similar to Database Analytics for PGDM first - year (20)

PPTX
Elementary Data Analysis with MS Excel_Day-3
PPS
Excel Tips
PPT
Excel Tips
PPS
Excel Tips
PPS
Microsoft Excel Tips
PPT
Excel Tips
PDF
Advanced Excel formulas, v look up, count, count if, pivot tables, filters
PDF
Excel Advance Training Manual for Business
PPT
Advanced Excel ppt
PDF
Excel
PDF
Microsoft Excel- basics
PPTX
MIS 226: Chapter 2
PPTX
micro soft advanced excel setting it up with micro soft excelppt.pptx
PDF
BA.pdf
PPT
Unit-1.pptUnit-1.pptUnit-1.pptUnit-1.ppt
PPT
Microsoft Office Excel 2003 Sorting And Filtering
PPTX
Advanced Excel Features with Matt Hansen at StatStuff
PPS
PPT
Excel tips
PPT
Excel Tips 101
Elementary Data Analysis with MS Excel_Day-3
Excel Tips
Excel Tips
Excel Tips
Microsoft Excel Tips
Excel Tips
Advanced Excel formulas, v look up, count, count if, pivot tables, filters
Excel Advance Training Manual for Business
Advanced Excel ppt
Excel
Microsoft Excel- basics
MIS 226: Chapter 2
micro soft advanced excel setting it up with micro soft excelppt.pptx
BA.pdf
Unit-1.pptUnit-1.pptUnit-1.pptUnit-1.ppt
Microsoft Office Excel 2003 Sorting And Filtering
Advanced Excel Features with Matt Hansen at StatStuff
Excel tips
Excel Tips 101
Ad

Recently uploaded (20)

PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Computer network topology notes for revision
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PDF
Lecture1 pattern recognition............
PPTX
Database Infoormation System (DBIS).pptx
PPTX
Introduction to machine learning and Linear Models
PPT
Quality review (1)_presentation of this 21
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
Reliability_Chapter_ presentation 1221.5784
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Computer network topology notes for revision
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Supervised vs unsupervised machine learning algorithms
Business Ppt On Nestle.pptx huunnnhhgfvu
Galatica Smart Energy Infrastructure Startup Pitch Deck
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Business Acumen Training GuidePresentation.pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Lecture1 pattern recognition............
Database Infoormation System (DBIS).pptx
Introduction to machine learning and Linear Models
Quality review (1)_presentation of this 21
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
1_Introduction to advance data techniques.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
Ad

Database Analytics for PGDM first - year

  • 1. Slide - 1 Business Analytics: Methods, Models, and Decisions Third Edition, Global Edition Chapter 2 Database Analytics Copyright © 2021 Pearson Education Ltd.
  • 2. Copyright © 2021 Pearson Education Ltd. Slide - 2 Data Sets and Databases • Data set - a collection of data – Examples: Marketing survey responses, a table of historical stock prices, and a collection of measurements of dimensions of a manufactured item • Database - a collection of related files containing records on people, places, or things – A database file is usually organized in a two- dimensional table, where the columns correspond to each individual element of data (called fields, or attributes), and the rows represent records of related data elements.
  • 3. Copyright © 2021 Pearson Education Ltd. Slide - 3 Example 2.1: A Purchase Order Database • Each row represents a record. • Each column represents a field or attribute.
  • 4. Copyright © 2021 Pearson Education Ltd. Slide - 4 Example 2.2: Using Range Names for a Database • Define the range name for each row of data as the month, and the name for each column of data by the product. Example: The range name for B4:F4 is January; the range name for B4:B15 is Product_A. To find the annual sales of Product A, use the Excel formula =SUM(Product_A).
  • 5. Copyright © 2021 Pearson Education Ltd. Slide - 5 Data Queries: Tables • An Excel table allows you to use table references to perform basic calculations. Select the data range including headers. Next, click Table from the Tables group on the Insert tab and make sure that the box for My Table Has Headers is checked. • The table name (default: Table1),can be found (and changed) in the Properties group of the Table Tools Design tab in Windows or in the Table tab on a Mac.
  • 6. Copyright © 2021 Pearson Education Ltd. Slide - 6 Example 2.3: Excel Table for Credit Risk Data
  • 7. Copyright © 2021 Pearson Education Ltd. Slide - 7 Example 2.4: Table-Based Calculations • To sum the data in column C, use the function =SUM(Table1[Savings]). • To find the number of home owners use the function =COUNTIF(Table1[Housing], “Own”). • If we add new records to the table, the calculation will be updated automatically.
  • 8. Copyright © 2021 Pearson Education Ltd. Slide - 8 • Select a cell (but not the header) in the column for sorting. – Use the AZ or ZA buttons on the Data tab to sort from low to high or high to low. • Click the Sort button for advanced sorting. Data Queries: Sorting Data 3-8
  • 9. Copyright © 2021 Pearson Education Ltd. Slide - 9 • Sort data by supplier. Example 2.5: Sorting Data in the Purchase Orders Database
  • 10. Copyright © 2021 Pearson Education Ltd. Slide - 10  An Italian economist, Vilfredo Pareto, observed in 1906 that a large proportion of the wealth in Italy was owned by a small proportion of the people.  Similarly, businesses often find that a large proportion of sales come from a small proportion of customers, the “80-20 rule.”  A Pareto analysis involves sorting data and calculating cumulative proportions. 3-10 Pareto Analysis
  • 11. Copyright © 2021 Pearson Education Ltd. Slide - 11 • In the Bicycle Inventory database, compute the inventory value of each product by multiplying the quantity on hand by the purchase cost. Sort the data in decreasing order of inventory value and compute the percentage of the total inventory value for each product and the cumulative percentage. Example 2.6: Applying the Pareto Principle
  • 12. Copyright © 2021 Pearson Education Ltd. Slide - 12 • Filtering is finding a subset of records that meet certain characteristics. • Excel provides two filtering tools: – AutoFilter for simple criteria – Advanced Filter for more complex criteria. Data Queries: Filtering Data 3-12
  • 13. Copyright © 2021 Pearson Education Ltd. Slide - 13 • First, select any cell within the database. Then, from the Data tab, click Filter. Click on cell D3 dropdown arrow. Select only Bolt- nut package. 3-13 Example 2.7: Filtering Purchase Order Records by Item Description
  • 14. Copyright © 2021 Pearson Education Ltd. Slide - 14 • The Filter tool will display only those orders for this item. • To restore the original data file, click on the drop- down arrow again and then click Clear filter from “Item Description.” Example 2.7 Continued
  • 15. Copyright © 2021 Pearson Education Ltd. Slide - 15 • Identify all records in the Purchase Orders database whose item cost is at least $200. • Click on the drop-down arrow in the Item Cost column and position the cursor over Numbers Filter. Select Greater Than Or Equal To . . . from the list. Example 2.8: Filtering Records by Item Cost
  • 16. Copyright © 2021 Pearson Education Ltd. Slide - 16 • This brings up a Custom AutoFilter dialog that allows you to specify up to two specific criteria using “and” and “or” logic. (The Mac version does not have these and/or options.) Enter 200 in the box and then click OK. Example 2.8 Continued
  • 17. Copyright © 2021 Pearson Education Ltd. Slide - 17 • The Filter tool does not extract the records; it simply hides the records that don’t match the criteria. – This means that if you highlight a range of filtered data to compute a sum or average, for example, you will get the results for all records, including those that are hidden from view. – You can copy and paste the filtered data to another range or Excel worksheet, which then uses only the filtered records, and get the correct results. Caution!
  • 18. Copyright © 2021 Pearson Education Ltd. Slide - 18 • The Advanced Filter provides a way of explicitly defining criteria by which to filter a database. • First, copy the headers from the database to an open location in the worksheet. Under the headers, specify the criteria that you want to use to filter the data. – Multiple criteria in the same row are logically joined by “and,” while criteria in rows are joined by “or.” Advanced Filter
  • 19. Copyright © 2021 Pearson Education Ltd. Slide - 19 • For the Purchase Orders database, we will find all the records for Hulkey Fasteners having order quantities that exceed 5,000 and order dates before 9/1/11, as well as all records for Steelpin Inc. with order quantities less than 5,000 and order dates before 9/1/11. Example 2.9: Using the Advanced Filter
  • 20. Copyright © 2021 Pearson Education Ltd. Slide - 20 • Choose Advanced next to the Filter in the Data tab. In the dialog box, enter the list range of the database and the criteria range. Example 2.9 Continued
  • 21. Copyright © 2021 Pearson Education Ltd. Slide - 21 • Results – Note that only the records meeting the criteria are displayed. Example 2.9 Continued
  • 22. Copyright © 2021 Pearson Education Ltd. Slide - 22 • Database functions start with a “D” (for example, DSUM, DAVERAGE, DCOUNT) and allow you to specify criteria that limit the calculations to a subset of records using the same format as the Advanced Filter. • For example, the syntax for the DSUM function is DSUM(database, field, criteria). Database is the range that includes the column labels; field is the column name that contains the values to sum, enclosed in quotation marks, or a reference to the column name; and criteria is the range that specifies the records you want to sum. Database Functions
  • 23. Copyright © 2021 Pearson Education Ltd. Slide - 23 • In the Purchase Orders database, find the total cost of all orders that meet the criteria specified in Example 2.9: • Alternatively, we could have used the function =DSUM(A8:J102,“Cost per order”, A3:J5). Example 2.10: Using a Database Function
  • 24. Copyright © 2021 Pearson Education Ltd. Slide - 24 Logical Functions • =IF(condition, value if true, value if false) – returns one value if the condition is true and another if the condition is false, • – returns TRUE if all conditions are true and FALSE if not, • – returns TRUE if any condition is true and FALSE if not.
  • 25. Copyright © 2021 Pearson Education Ltd. Slide - 25 IF Function • =IF(condition, value if true, value if false) • Conditions may include the following:
  • 26. Copyright © 2021 Pearson Education Ltd. Slide - 26 Example 2.11: Using the IF Function • Suppose that orders with quantities of at least 10,000 units are classified as Large. – Cell K4: • Suppose that large orders with a total cost of at least $25,000 are considered critical. – Cell L4:
  • 27. Copyright © 2021 Pearson Education Ltd. Slide - 27 Nesting IF Functions • You may “nest” up to seven IF functions by replacing value if true or value if false in an IF function with another IF function: =IF(A8= 2,(IF(B3= 5, “YES”, “”)),15)
  • 28. Copyright © 2021 Pearson Education Ltd. Slide - 28 Example 2.12: Calculating the Price of Quantity Discounts • For quantities of 1,000 or less, the unit price is $10; for quantities of 1,001 to 5,000, the unit price is $9.00; and for quantities that exceed 5,000, the unit price is $7.50. – IF(Q = 1,000, Q*10, value if false) – IF(Q = 1,000, Q*10, IF(Q6 <= 5,000, Q*9, value if false)) – IF(Q = 1,000, Q*10, IF(Q6 <= 5,000, Q*9, Q*7.5))
  • 29. Copyright © 2021 Pearson Education Ltd. Slide - 29 Lookup Functions for Database Queries • - looks up a value in the leftmost column of a table and returns a value in the same row from a column you specify • - looks up a value in the top row of a table and returns a value in the same column from a row you specify. • - returns a value or reference of the cell at the intersection of a particular row and column in a given range. • - returns the relative position of an item in an array that matches a specified value in a specified order. =CHOOSE(index_num, value1, value2, . . . ) - returns a value from a list based on the position in the list, specified by index_num . •
  • 30. Copyright © 2021 Pearson Education Ltd. Slide - 30 Important Notes on Lookup Functions • In the VLOOKUP and HLOOKUP functions, range lookup is optional. If this is omitted or set as True, then the first column of the table must be sorted in ascending numerical order. • If an exact match for the is found in the first column, then Excel will return the value of of that row. If an exact match is not found, Excel will choose the row with the largest value in the first column that is less than the • If range lookup is False, then Excel seeks an exact match in the first column of the table range. If no exact match is found, Excel will return #N/A (not available). Specify the range lookup to avoid errors!
  • 31. Copyright © 2021 Pearson Education Ltd. Slide - 31 Example 2.13: Using the VLOOKUP Function returns the payment type Credit. returns the transaction code 80103311
  • 32. Copyright © 2021 Pearson Education Ltd. Slide - 32 INDEX Function • • The INDEX function returns the value in a particular row and column of an array. • would retrieve the transaction code 80103311, which is in the 7th row and 4th column of the database.
  • 33. Copyright © 2021 Pearson Education Ltd. Slide - 33 MATCH Function • • In the MATCH function, is value that you want to match in which is the range of cells being searched. The is either −1, 0, or 1. The default is 1. • If then the function finds the largest value that is less than or equal to – The values in the must be placed in ascending order • If MATCH finds the first value that is exactly equal to – The values in the can be in any order. • If then the function finds the smallest value that is – The values in the must be placed in descending order. greater than or equal to lookup_value
  • 34. Copyright © 2021 Pearson Education Ltd. Slide - 34 Example 2.14: Using INDEX and MATCH Functions for Database Queries Suppose we wish to design a simple query application to input the month and product name, and retrieve the corresponding sales. The three additional worksheets in the workbook show how to do this in three different ways.
  • 35. Copyright © 2021 Pearson Education Ltd. Slide - 35 Example 2.14 Continued: Using VLOOKUP + If The Query1 worksheet uses the VLOOKUP function with embedded IF statements. The formulas in cell I8 is:
  • 36. Copyright © 2021 Pearson Education Ltd. Slide - 36 Example 2.14 Continued: Using VLOOKUP + MATCH The formula in cell I8 is: In this case, the MATCH function is used to identify the column in the table corresponding to the product name in cell I6. Note the use of the “+1” to shift the relative column number of the product to the correct column number in the lookup table. = VLOOKUP (I5,A4:F15,MATCH(I6,B3:F3,0) + 1,FALSE)
  • 37. Copyright © 2021 Pearson Education Ltd. Slide - 37 Example 2.14 Continued: Using INDEX + MATCH The formula in cell I8 is: = INDEX(A4:F15,MATCH(I5,A4:A15,0),MATCH(I6,A3:F3,0)) The MATCH functions are used as arguments in the INDEX function to identify the row and column numbers in the table based on the month and product name. The INDEX function then retrieves the value in the corresponding row and column.
  • 38. Copyright © 2021 Pearson Education Ltd. Slide - 38 Example 2.15: Using INDEX and MATCH for a Left Table Lookup • In the Sales Transactions database, we wish to find the customer ID associated with a specific transaction code.
  • 39. Copyright © 2021 Pearson Education Ltd. Slide - 39 • Enter the transaction code in cell K2, and display the customer ID in cell K4. • Use the following formula in cell K4: =INDEX(A4:A475,MATCH(K2,D4:D475,0),1) Example 2.15 Continued 2-39
  • 40. Copyright © 2021 Pearson Education Ltd. Slide - 40 • User-friendly templates for repetitive database queries. • Characteristics: – ”Clean” – Well-organized – Easy to use Excel Template Design 4-40
  • 41. Copyright © 2021 Pearson Education Ltd. Slide - 41 Example 2.16: A Tax Bracket Calculator • 2016 U.S. federal income tax rates • Create a template that allows an individual to enter their filing status and taxable income and then returns the corresponding tax bracket.
  • 42. Copyright © 2021 Pearson Education Ltd. Slide - 42 Example 2.16 Continued: Using IF and VLOOKUP
  • 43. Copyright © 2021 Pearson Education Ltd. Slide - 43 Example 2.16 Continued: Using CHOOSE =CHOOSE($B$9,VLOOKUP($B$10,Lookup!$A$2:$E$8,5), VLOOKUP($B$10,Lookup!$B$2:$E$8,4),VLOOKUP($B$10, Lookup!$C$2:$E$8,3),VLOOKUP($B$10,Lookup!$D$2:$E$8, 2))
  • 44. Copyright © 2021 Pearson Education Ltd. Slide - 44 Data Validation Tools • Select the cell range for which data validation will be applied, and then choose Data Validation from the Data Tools group on the Data tab in Excel 2016, or select Validation from the Data menu on the a Mac.
  • 45. Copyright © 2021 Pearson Education Ltd. Slide - 45 Example 2.17: Applying Data Validation • For the Tax Bracket template, choose cell B9 (filing status). In the Data Validation dialog, specify that the value must be a whole number between 1 and 4. You may customize the Error Alert and Input Message to prompt the user.
  • 46. Copyright © 2021 Pearson Education Ltd. Slide - 46 ISNUMBER Function • This function returns TRUE if the cell or range contains a number; otherwise, it returns FALSE.
  • 47. Copyright © 2021 Pearson Education Ltd. Slide - 47 Example 2.18: Using the ISNUMBER Function for Data Validation • In the Tax template, use ISNUMBER to ensure that the taxable income in cell B10 is numeric. In the Data Validation dialog, choose Custom, and in the Formula box, enter the formula =ISNUMBER(B10). An error alert message will pop up if an invalid entry is made.
  • 48. Copyright © 2021 Pearson Education Ltd. Slide - 48 • Buttons, boxes, and other mechanisms for inputting or changing data on spreadsheets easily that can be used to design user-friendly spreadsheets. – Spin button—a button used to increase or decrease a numerical value – Scroll bar—a slider used to change a numerical value – Check box—a box used to select or deselect a scenario – Option button—a radio button used to select an option – List box—a box that provides a list of options – Combo box—a box that provides an expandable list of options – Group box—a box that can hold a group of controls Form Controls 4-48
  • 49. Copyright © 2021 Pearson Education Ltd. Slide - 49 • Activate the Developer tab on the Excel Ribbon. Form Controls 4-49
  • 50. Copyright © 2021 Pearson Education Ltd. Slide - 50 Example 2.19: Using Form Controls in the Tax Bracket Template • Insert the form control (spin button for filing status, and scroll bar for taxable income). • Right click and complete the Format Control dialog.
  • 51. Copyright © 2021 Pearson Education Ltd. Slide - 51 Format Control Dialog for Spin Button
  • 52. Copyright © 2021 Pearson Education Ltd. Slide - 52 Example 2.20: Using a Combo Box • Compute the total sales for any month in the Monthly Product Sales database.
  • 53. Copyright © 2021 Pearson Education Ltd. Slide - 53 Exploring Data Using PivotTables • Excel provides a powerful tool for distilling a complex data set into meaningful information: PivotTables. • PivotTables allows you to create custom summaries and charts of key information in the data. • PivotTables can be used to quickly create cross- tabulations and to drill down into a large set of data in numerous ways.
  • 54. Copyright © 2021 Pearson Education Ltd. Slide - 54 Example 2.21: Creating a PivotTable Click inside the Sales Transactions database The wizard creates a blank PivotTable as shown.
  • 55. Copyright © 2021 Pearson Education Ltd. Slide - 55 PivotTable Field List Select and drag the fields to one of the PivotTable areas: • Report Filter • Column Labels • Row Labels • Values
  • 56. Copyright © 2021 Pearson Education Ltd. Slide - 56 Pivot Table for Total Revenue by Region You may select the range of the value, right click, and format the cells as currency to make the PivotTable more meaningful. You may also replace the names in the headers; for instance, change Row Labels to Region and Sum of Amount to Revenue.
  • 57. Copyright © 2021 Pearson Education Ltd. Slide - 57 Revenue Breakdown by Region and Product
  • 58. Copyright © 2021 Pearson Education Ltd. Slide - 58 Alternate PivotTable View of Region and Product Revenue
  • 59. Copyright © 2021 Pearson Education Ltd. Slide - 59 PivotTable Customization • When you drag a field into the S Values area, the PivotTable defaults to the sum of the values in that field. Click the dropdown arrow next to Revenue in the S Values area and choose Value Field Settings. Select Count.
  • 60. Copyright © 2021 Pearson Education Ltd. Slide - 60 PivotTable for Count of Regional Sales by Product
  • 61. Copyright © 2021 Pearson Education Ltd. Slide - 61 Percentage Views • Percent of the grand total, Percent of row total, Percent of column total, and other options – In the Value Field Settings dialog, click the tab Show Values As. Select the option in the dropdown box. The % of Row Total is shown:
  • 62. Copyright © 2021 Pearson Education Ltd. Slide - 62 Using the PivotTable Report Filter • Dragging a field into the Filters area in the PivotTable Field list allows you to add a third dimension to your analysis. Drag Payment to the Filters area. Click the drop down arrow in cell B1; choose Credit.
  • 63. Copyright © 2021 Pearson Education Ltd. Slide - 63 Slicers Slicers are tools for drilling down to “slice” a PivotTable and display a subset of data. • To create a slicer for any of the columns in the database, click on the PivotTable and choose Insert Slicer from the Analyze tab in the PivotTable Tools ribbon in Windows, or from the PivotTable Analyze tab on a Mac.
  • 64. Copyright © 2021 Pearson Education Ltd. Slide - 64 Example 2.22: Using Slicers • For the PivotTable for the revenues by region and product, insert a slicer for the source of the transaction. If you click on one of the Source buttons, Email or Web, the PivotTable reflects only those records corresponding to that source.