Tải bản đầy đủ (.pdf) (371 trang)

Microsoft excel data analysis for dummies

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (14.35 MB, 371 trang )



Excel Data
Analysis
®



Excel Data
Analysis
®

5th Edition

by Paul McFedries


Excel® Data Analysis For Dummies®, 5th Edition
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright © 2022 by John Wiley & Sons, Inc., Hoboken, New Jersey
Media and software compilation copyright © 2022 by John Wiley & Sons, Inc. All rights reserved.
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to
the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River
Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at />Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related
trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written
permission. Microsoft and Excel are registered trademarks of Microsoft Corporation. All other trademarks are the
property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned
in this book.



LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: WHILE THE PUBLISHER AND AUTHORS HAVE USED THEIR
BEST EFFORTS IN PREPARING THIS WORK, THEY MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT
TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL
WARRANTIES, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES
REPRESENTATIVES, WRITTEN SALES MATERIALS OR PROMOTIONAL STATEMENTS FOR THIS WORK. THE FACT
THAT AN ORGANIZATION, WEBSITE, OR PRODUCT IS REFERRED TO IN THIS WORK AS A CITATION AND/OR
POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE PUBLISHER AND AUTHORS
ENDORSE THE INFORMATION OR SERVICES THE ORGANIZATION, WEBSITE, OR PRODUCT MAY PROVIDE OR
RECOMMENDATIONS IT MAY MAKE. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS
NOT ENGAGED IN RENDERING PROFESSIONAL SERVICES. THE ADVICE AND STRATEGIES CONTAINED HEREIN
MAY NOT BE SUITABLE FOR YOUR SITUATION. YOU SHOULD CONSULT WITH A SPECIALIST WHERE APPROPRIATE.
FURTHER, READERS SHOULD BE AWARE THAT WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR
DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. NEITHER THE PUBLISHER
NOR AUTHORS SHALL BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING
BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES.

For general information on our other products and services, please contact our Customer Care Department within
the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit
/>Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with
standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to
media such as a CD or DVD that is not included in the version you purchased, you may download this material at
. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number is available from the publisher.
ISBN 978-1-119-84442-6 (pbk); ISBN 978-1-119-84446-4 (ebk); ISBN 978-1-119-84447-1 (ebk)


Contents at a Glance
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Part 1: Getting Started with Data Analysis. . . . . . . . . . . . . . . . . . . . . 5
CHAPTER 1:
CHAPTER 2:
CHAPTER 3:
CHAPTER 4:
CHAPTER 5:

Learning Basic Data-Analysis Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Working with Data-Analysis Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Introducing Excel Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Grabbing Data from External Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Analyzing Table Data with Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

Part 2: Analyzing Data Using PivotTables and
PivotCharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

113

CHAPTER 6:

Creating and Using PivotTables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Performing PivotTable Calculations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
CHAPTER 8: Building PivotCharts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
CHAPTER 7:

Part 3: Discovering Advanced Data-Analysis Tools . . . . . . . .
CHAPTER 9:

181


Dealing with Data Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Trends and Making Forecasts. . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 11: Analyzing Data Using Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 12: Analyzing Data Using Descriptive Statistics. . . . . . . . . . . . . . . . . . . . . . .
CHAPTER 13: Analyzing Data Using Inferential Statistics. . . . . . . . . . . . . . . . . . . . . . . .

183
203
227
245
261

Part 4: The Part of Tens. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

279

CHAPTER 10: Tracking

CHAPTER 14: Ten

Things You Ought to Know about Statistics. . . . . . . . . . . . . . . . . . . 281
Ways to Analyze Financial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
CHAPTER 16: Ten Ways to Raise Your PivotTable Game . . . . . . . . . . . . . . . . . . . . . . . . 303
CHAPTER 15: Ten

Appendix: Glossary of Data Analysis and Excel Terms. . . .

317

Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


327



Table of Contents
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
About This Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What You Can Safely Ignore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Foolish Assumptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Icons Used in This Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Beyond the Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Where to Go from Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
2
2
3
3
4

PART 1: GETTING STARTED WITH DATA ANALYSIS . . . . . . . . . . 5
CHAPTER 1:

Learning Basic Data-Analysis Techniques. . . . . . . . . . . . . 7
What Is Data Analysis, Anyway?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Cooking raw data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Dealing with data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Building data models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Performing what-if analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Analyzing Data with Conditional Formatting. . . . . . . . . . . . . . . . . . . . . . . 9
Highlighting cells that meet some criteria. . . . . . . . . . . . . . . . . . . . . 10
Showing pesky duplicate values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Highlighting the top or bottom values in a range. . . . . . . . . . . . . . . 13
Analyzing cell values with data bars. . . . . . . . . . . . . . . . . . . . . . . . . . 14
Analyzing cell values with color scales. . . . . . . . . . . . . . . . . . . . . . . . 15
Analyzing cell values with icon sets. . . . . . . . . . . . . . . . . . . . . . . . . . .16
Creating a custom conditional-formatting rule. . . . . . . . . . . . . . . . . 17
Editing a conditional-formatting rule. . . . . . . . . . . . . . . . . . . . . . . . . 20
Removing conditional-formatting rules. . . . . . . . . . . . . . . . . . . . . . . 21
Summarizing Data with Subtotals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Grouping Related Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Consolidating Data from Multiple Worksheets. . . . . . . . . . . . . . . . . . . . 26
Consolidating by position. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Consolidating by category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

CHAPTER 2:

Working with Data-Analysis Tools. . . . . . . . . . . . . . . . . . . . . 31
Working with Data Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a basic data table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a two-input data table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Skipping data tables when calculating workbooks. . . . . . . . . . . . . .
Analyzing Data with Goal Seek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Analyzing Data with Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Create a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Apply a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table of Contents


32
32
34
37
37
39
40
42

vii


Edit a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Delete a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Optimizing Data with Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Understanding Solver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
The advantages of Solver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
When should you use Solver? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Loading the Solver add-in. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Optimizing a result with Solver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Adding constraints to Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Save a Solver solution as a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . 52
CHAPTER 3:

Introducing Excel Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
What Is a Table and Why Should I Care? . . . . . . . . . . . . . . . . . . . . . . . . .
Building a Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting the data from an external source. . . . . . . . . . . . . . . . . . . . .
Converting a range to a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Basic table maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Analyzing Table Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying simple statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding a column subtotal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sorting table records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering table records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clearing a filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Turning off AutoFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying a predefined AutoFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying multiple filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying advanced filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CHAPTER 4:

Grabbing Data from External Sources. . . . . . . . . . . . . . . . 77
What’s All This about External Data? . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exporting Data from Other Programs . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing External Data into Excel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing data from an Access table. . . . . . . . . . . . . . . . . . . . . . . . .
Importing data from a Word table . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introducing text file importing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing a delimited text file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing a fixed-width text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing data from a web page . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing an XML file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Querying External Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Querying a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

viii


55
57
58
58
60
61
61
63
64
67
68
68
69
71
72

Excel Data Analysis For Dummies

77
79
80
80
81
82
83
84
86
88
90
91

94


CHAPTER 5:

Analyzing Table Data with Functions. . . . . . . . . . . . . . . . . 99
The Database Functions: Some General Remarks. . . . . . . . . . . . . . . .
Retrieving a Value from a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Summing a Column’s Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting a Column’s Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Averaging a Column’s Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining a Column’s Maximum and Minimum Values. . . . . . . . .
Multiplying a Column’s Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deriving a Column’s Standard Deviation. . . . . . . . . . . . . . . . . . . . . . . .
Calculating a Column’s Variance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

100
101
102
104
105
106
108
109
110

PART 2: ANALYZING DATA USING PIVOTTABLES
AND PIVOTCHARTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

113


Creating and Using PivotTables. . . . . . . . . . . . . . . . . . . . . .

115

Understanding PivotTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exploring PivotTable Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Building a PivotTable from an Excel Range or Table . . . . . . . . . . . . . .
Creating a PivotTable from External Data. . . . . . . . . . . . . . . . . . . . . . .
Building a PivotTable from Microsoft Query. . . . . . . . . . . . . . . . . .
Building a PivotTable from a new data connection . . . . . . . . . . . .
Refreshing PivotTable Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Refreshing PivotTable data manually. . . . . . . . . . . . . . . . . . . . . . . .
Refreshing PivotTable data automatically. . . . . . . . . . . . . . . . . . . .
Adding Multiple Fields to a PivotTable Area . . . . . . . . . . . . . . . . . . . . .
Pivoting a Field to a Different Area. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Grouping PivotTable Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Grouping numeric values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Grouping date and time values. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Grouping text values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering PivotTable Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying a report filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering row or column items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering PivotTable values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering a PivotTable with a slicer. . . . . . . . . . . . . . . . . . . . . . . . . . .

116
118
119
122

122
123
125
125
125
126
127
128
128
129
130
131
131
132
133
134

Performing PivotTable Calculations. . . . . . . . . . . . . . . . .

137

Messing around with PivotTable Summary Calculations . . . . . . . . . .
Changing the PivotTable summary calculation. . . . . . . . . . . . . . . .
Trying out the difference summary calculation . . . . . . . . . . . . . . .
Applying a percentage summary calculation . . . . . . . . . . . . . . . . .
Adding a running total summary calculation . . . . . . . . . . . . . . . . .
Creating an index summary calculation. . . . . . . . . . . . . . . . . . . . . .

138
138

140
142
144
147

CHAPTER 6:

CHAPTER 7:

Table of Contents

ix


Working with PivotTable Subtotals. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Turning off subtotals for a field. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying multiple subtotals for a field. . . . . . . . . . . . . . . . . . . . . .
Introducing Custom Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formulas for custom calculations. . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking out the custom calculation types. . . . . . . . . . . . . . . . . . .
Understanding custom calculation limitations. . . . . . . . . . . . . . . .
Inserting a Custom Calculated Field. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inserting a Custom Calculated Item. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing a Custom Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting a Custom Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

149
149
149
151

151
152
152
154
155
157
158

Building PivotCharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

161

Introducing the PivotChart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding PivotChart pros and cons. . . . . . . . . . . . . . . . . . . .
Taking a PivotChart tour. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding PivotChart limitations . . . . . . . . . . . . . . . . . . . . . . .
Creating a PivotChart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a PivotChart from a PivotTable . . . . . . . . . . . . . . . . . . . . .
Embedding a PivotChart on a PivotTable’s worksheet. . . . . . . . . .
Creating a PivotChart from an Excel range or table. . . . . . . . . . . .
Working with PivotCharts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving a PivotChart to another sheet. . . . . . . . . . . . . . . . . . . . . . .
Filtering a PivotChart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing the PivotChart type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding data labels to your PivotChart . . . . . . . . . . . . . . . . . . . . . . .
Sorting the PivotChart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding PivotChart titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Moving the PivotChart legend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying a data table with the PivotChart. . . . . . . . . . . . . . . . . . .


161
162
163
164
165
165
165
166
169
169
170
172
173
174
175
177
178

PART 3: DISCOVERING ADVANCED DATA-ANALYSIS
TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

181

CHAPTER 8:

CHAPTER 9:

x

Dealing with Data Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . .


183

Understanding Excel Data Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a relationship between tables. . . . . . . . . . . . . . . . . . . . . .
Importing related external data tables . . . . . . . . . . . . . . . . . . . . . .
Basing a PivotTable on multiple, related tables . . . . . . . . . . . . . . .
Managing a Data Model with Power Pivot. . . . . . . . . . . . . . . . . . . . . . .
Enabling the Power Pivot add-in. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding a table to the Data Model. . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing related tables from an external data source . . . . . . . .
Viewing table relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

184
186
187
189
192
192
193
193
195

Excel Data Analysis For Dummies


CHAPTER 10:

CHAPTER 11:


Viewing relationship details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a relationship between tables with Power Pivot. . . . . . .
Transforming Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a PivotTable or PivotChart from Your Data Model. . . . . . . .

196
197
199
200

Tracking Trends and Making Forecasts. . . . . . . . . . . . .

203

Plotting a Best-Fit Trend Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating Best-Fit Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting Forecasted Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extending a Linear Trend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extending a linear trend using the fill handle. . . . . . . . . . . . . . . . .
Extending a linear trend using the Series command. . . . . . . . . . .
Calculating Forecasted Linear Values. . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting an Exponential Trend Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating Exponential Trend Values . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting a Logarithmic Trend Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting a Power Trend Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting a Polynomial Trend Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Forecast Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

204
206

208
210
211
211
212
214
216
218
220
222
223

Analyzing Data Using Statistics . . . . . . . . . . . . . . . . . . . . . .

227

Counting Things. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting nonempty cells. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting empty cells. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting cells that match criteria. . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting cells that match multiple criteria. . . . . . . . . . . . . . . . . . .
Counting permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counting combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Averaging Things. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating an average . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating a conditional average. . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating an average based on multiple conditions. . . . . . . . . .
Calculating the median. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Finding the Rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining the Nth Largest or Smallest Value. . . . . . . . . . . . . . . . . .
Calculating the nth highest value . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the nth smallest value . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Grouped Frequency Distribution. . . . . . . . . . . . . . . . . . . . .
Calculating the Variance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Finding the Correlation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

228
228
229
229
229
230
231
232
233
233
233
234
235
235
236
238
238
239
240
241
242

243

Table of Contents

xi


CHAPTER 12:

245

Loading the Analysis ToolPak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generating Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating a Moving Average . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining Rank and Percentile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generating Random Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Frequency Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

246
247
250
253
255
258

Analyzing Data Using Inferential Statistics. . . . . . . .

261

Sampling Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the t-Test Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performing a z-Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining the Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the Covariance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Anova Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performing an f-Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

262
264
267
269
271
273
274
276

PART 4: THE PART OF TENS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

279

CHAPTER 13:

CHAPTER 14:

CHAPTER 15:

xii

Analyzing Data Using Descriptive Statistics . . . . . . .


Ten Things You Ought to Know about
Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Descriptive Statistics Are Straightforward. . . . . . . . . . . . . . . . . . . . . . .
Averages Aren’t So Simple Sometimes. . . . . . . . . . . . . . . . . . . . . . . . . .
Standard Deviations Describe Dispersion. . . . . . . . . . . . . . . . . . . . . . .
An Observation Is an Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Sample Is a Subset of Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inferential Statistics Are Cool But Complicated . . . . . . . . . . . . . . . . . .
Probability Distributions Aren’t Always Confusing. . . . . . . . . . . . . . . .
Uniform distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Normal distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parameters Aren’t So Complicated. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Skewness and Kurtosis Describe a Probability
Distribution’s Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Confidence Intervals Seem Complicated at First But Are Useful. . . .

282
282
283
285
285
285
287
287
288
289

Ten Ways to Analyze Financial Data . . . . . . . . . . . . . . . .


293

Calculating Future Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating Present Value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining Loan Payments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating a Loan Payment’s Principal and Interest. . . . . . . . . . . . . .
Calculating Cumulative Loan Principal and Interest. . . . . . . . . . . . . . .
Finding the Required Interest Rate. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining the Internal Rate of Return. . . . . . . . . . . . . . . . . . . . . . . .

294
295
296
297
297
298
299

Excel Data Analysis For Dummies

289
291


Calculating Straight-Line Depreciation. . . . . . . . . . . . . . . . . . . . . . . . . . 300
Returning the Fixed-Declining Balance Depreciation. . . . . . . . . . . . . . 300
Determining the Double-Declining Balance Depreciation. . . . . . . . . .301

Ten Ways to Raise Your PivotTable Game. . . . . . . . . .


303

Turn the PivotTable Fields Task Pane On and Off . . . . . . . . . . . . . . . .
Change the PivotTable Fields Task Pane Layout. . . . . . . . . . . . . . . . . .
Display the Details Behind PivotTable Data . . . . . . . . . . . . . . . . . . . . .
Apply a PivotTable Style. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Create a Custom PivotTable Style. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Preserve PivotTable Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rename the PivotTable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Turn Off Grand Totals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reduce the Size of PivotTable Workbooks. . . . . . . . . . . . . . . . . . . . . . .
Use a PivotTable Value in a Formula . . . . . . . . . . . . . . . . . . . . . . . . . . .

304
304
306
308
309
311
312
312
314
314

APPENDIX: GLOSSARY OF DATA ANALYSIS
AND EXCEL TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

317

INDEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


327

CHAPTER 16:

Table of Contents

xiii



Introduction

T

he world is bursting at the seams with data. It’s on our computers, it’s in
our networks, it’s on the web. Some days, it seems to be in the very air
itself, borne on the wind. But here’s the thing: No one actually cares about
data. A collection of data — whether it resides on your PC or some giant server
somewhere — is really just a bunch of numbers and text, dates and times. No one
cares about data because data doesn’t mean anything. Data isn’t cool. You know
what’s cool? Knowledge is cool. Insight is cool.
So how do you turn data into knowledge? How do you tweak data to generate
insight? You need to organize that data, and then you need to sort it, filter it, run
calculations on it, and summarize it. In a word, you need to analyze the data.
Now for the good news: If you have (or can get) that data into Excel, you have a
giant basket of data-analysis tools at your disposal. Excel really seems to have
been made with data analysis in mind, because it offers such a wide variety of
features and techniques for organizing, manipulating, and summarizing just
about anything that resides in a worksheet. If you can get your data into Excel, it

will help you turn that data into knowledge and insight.
This book takes you on a tour of Excel’s data-analysis tools. You learn everything
you need to know to make your data spill its secrets and to uncover your data’s
hidden-in-plain-sight wisdom. Best of all, if you already know how to perform
the basic Excel chores, you don’t need to learn any other fancy-schmancy Excel
techniques to get started in data analysis. Sweet? You bet.

About This Book
This book contains 16 chapters (and a bonus appendix), but that doesn’t mean
that you have to, as the King says gravely in Alice’s Adventures in Wonderland,
“Begin at the beginning and go on till you come to the end: Then stop.” If you’ve
done a bit of data-analysis work in the past, please feel free to dip into the book
wherever it strikes your fancy. The chapters all present their data-analysis info
and techniques in readily digestible, bite-sized chunks, so you can certainly graze
your way through this book.

Introduction

1


However, if you’re brand spanking new to data analysis — particularly if you’re
not even sure what data analysis even is — no problem: I’m here to help. To get
your data-analysis education off to a solid start, I highly recommend reading the
book’s first three chapters to get some of the basics down cold. From there, you
can travel to more advanced territory, safe in the knowledge that you’ve got some
survival skills to fall back on.

What You Can Safely Ignore
This book consists of several hundred pages. Do I expect you to read every word

on every page? Yes, I do. Just kidding! No, of course I don’t. Entire sections  —
heck, maybe even entire chapters — might contain information that’s not relevant
to what you do. That’s fine and my feelings won’t be hurt if you skim through
(or — who’s kidding whom? — skip over) those parts of the book.
If time (or attention) is short, what else might you want to ignore? Okay, in many
places throughout the book I provide step-by-step instructions to complete some
task. Each of those steps includes some bold type that gives you the basic
­instruction. In many cases, however, below that bold text I offer supplementary
information to flesh out or extend or explain the bold instruction. Am I just
showing off how much I know about all this stuff? Yes, sometimes. Do you have to
read these extended instructions? Nope. Read the bold stuff, for sure, but feel free
to skip the details if they seem unnecessary or unimportant.

Foolish Assumptions
This book is for people who are new (or relatively new) to Excel data analysis. That
doesn’t mean, however, that the book is suitable to people who have never used
a PC, Microsoft Windows, or even Excel. So first I assume not only that you have a
PC running Microsoft Windows but also that you’ve had some experience with
both. (For the purposes of this book, that just means you know how to start and
switch between programs.) I also assume that your PC has a recent version of
Excel installed. What does “recent” mean? Well, this book is based on Excel 2021,
but you should be fine if you’re running Excel 365, Excel 2019, Excel 2016, or even
Excel 2013.
As I said before, I do not assume that you’re an Excel expert, but I do assume that
you know at least the following Excel basics:

2

Excel Data Analysis For Dummies



»» Creating, saving, opening, and switching between workbooks
»» Creating and switching between worksheets
»» Finding and running commands on the Ribbon
»» Entering numbers, text, dates, times, and formulas into worksheet cells
»» Working with Excel’s basic worksheet functions

Icons Used in This Book
Like other books in the For Dummies series, this book uses icons, or little margin
pictures, to flag things that don’t quite fit into the flow of the chapter discussion.
Here are the icons that I use:
This icon marks text that contains some things that are useful or important
enough that you’d do well to store the text somewhere safe in your memory for
later recall.
This icon marks text that contains some for-nerds-only technical details or
explanations that you’re free to skip.

This icon marks text that contains a shortcut or an easier way to do things, which
I hope will make your life — or, at least, the data-analysis portion of your life —
more efficient.
This icon marks text that contains a friendly but unusually insistent reminder to
avoid doing something. You have been warned.

Beyond the Book
»» Examples: This book’s sample Excel workbooks can be found by going
to www.dummies.com/go/exceldataanalysisfd5e or at my website:
www.paulmcfedries.com.

»» Cheat Sheet: To locate this book’s cheat sheet, go to www.dummies.com and
search for Excel Data Analysis For Dummies. See the cheat sheet for info on


Introduction

3


Excel database functions, Boolean expressions, and important statistical
terms.

»» Updates: If this book has any updates after printing, they will be posted to
this book’s page at www.dummies.com.

Where to Go from Here
If you’re just getting your feet wet with Excel data analysis, flip the page and start
perusing the first chapter.
If you have some experience with Excel data analysis or you have a special problem or question, use the Table of Contents or the index to find out where I cover
that topic and then turn to that page.
Either way, happy analyzing!

4

Excel Data Analysis For Dummies


1

Getting Started
with Data
Analysis



IN THIS PART . . .

Understand data analysis and get to know basic
analysis features such as conditional formatting and
subtotals.
Discover Excel’s built-in tools for analyzing data.
Learn how to build Excel tables that hold and store the
data you need to analyze.
Find quick and easy ways to begin your analysis using
simple statistics, sorting, and filtering.
Get practical stratagems and common-sense tactics
for grabbing data from extra sources.


IN THIS CHAPTER

»» Learning about data analysis
»» Analyzing data by applying
conditional formatting
»» Adding subtotals to summarize data
»» Grouping related data
»» Combining data from multiple
worksheets

1

Chapter 

Learning Basic

Data-Analysis Techniques

Y

ou are awash in data. Information multiplies around you so fast that you
wonder how to make sense of it all. You think, “I know what to do. I’ll paste
the data into Excel. That way, at least the data will be nicely arranged in the
worksheet cells, and I can add a little formatting to make things somewhat palatable.” That’s a fine start, but you’re often called upon to do more with your data
than make it merely presentable. Your boss, your customer, or perhaps just your
curiosity requires you to divine some inner meaning from the jumble of numbers
and text that litter your workbooks. In other words, you need to analyze your data
to see what nuggets of understanding you can unearth.
This chapter gets you started down that data-analysis path by exploring a few
straightforward but useful analytic techniques. After discovering what data analysis entails, you investigate a number of Excel data-analysis techniques, including conditional formatting, data bars, color scales, and icon sets. From there, you
dive into some useful methods for summarizing your data, including subtotals,
grouping, and consolidation. Before you know it, that untamed wilderness of a
worksheet will be nicely groomed and landscaped.

CHAPTER 1 Learning Basic Data-Analysis Techniques

7


What Is Data Analysis, Anyway?
Are you wondering, “What is data analysis, anyway?” That’s an excellent question! Here’s an answer that I unpack for you as I go along: Data analysis is the
application of tools and techniques to organize, study, reach conclusions, and
sometimes make predictions about a specific collection of information.
For example, a sales manager might use data analysis to study the sales history of
a product, determine the overall trend, and produce a forecast of future sales. A
scientist might use data analysis to study experimental findings and determine

the statistical significance of the results. A family might use data analysis to find
the maximum mortgage it can afford or how much it must put aside each month
to finance retirement or the kids’ education.

Cooking raw data
The point of data analysis is to understand information on some deeper, more
meaningful level. By definition, raw data is a mere collection of facts that by themselves tell you little or nothing of any importance. To gain some understanding of
the data, you must manipulate the data in some meaningful way. The purpose of
manipulating data can be something as simple as finding the sum or average of a
column of numbers or as complex as employing a full-scale regression analysis to
determine the underlying trend of a range of values. Both are examples of data
analysis, and Excel offers a number of tools — from the straightforward to the
sophisticated — to meet even the most demanding needs.

Dealing with data
The data part of data analysis is a collection of numbers, dates, and text that represents the raw information you have to work with. In Excel, this data resides
inside a worksheet, which makes the data available for you to apply Excel’s satisfyingly large array of data-analysis tools.
Most data-analysis projects involve large amounts of data, and the fastest and
most accurate way to get that data onto a worksheet is to import it from a nonExcel data source. In the simplest scenario, you can copy the data from a text file,
a Word table, or an Access datasheet and then paste it into a worksheet. However,
most business and scientific data is stored in large databases, so Excel offers tools
to import the data you need into your worksheet. I talk about all this in more detail
later in the book.

8

PART 1 Getting Started with Data Analysis


After you have your data in the worksheet, you can use the data as is to apply

many data-analysis techniques. However, if you convert the range into a table,
Excel treats the data as a simple database and enables you to apply a number of
database-specific analysis techniques to the table.

Building data models
In many cases, you perform data analysis on worksheet values by organizing
those values into a data model, a collection of cells designed as a worksheet version
of some real-world concept or scenario. The model includes not only the raw data
but also one or more cells that represent some analysis of the data. For example,
a mortgage amortization model would have the mortgage data  — interest rate,
principal, and term — and cells that calculate the payment, principal, and interest
over the term. For such calculations, you use formulas and Excel’s built-in worksheet functions.

Performing what-if analysis
One of the most common data-analysis techniques is what-if analysis, for which
you set up worksheet models to analyze hypothetical situations. The “what-if”
part means that these situations usually come in the form of a question: “What
happens to the monthly payment if the interest rate goes up by 2 percent?” “What
will the sales be if you increase the advertising budget by 10 percent?” Excel offers
four what-if analysis tools: data tables, Goal Seek, Solver, and scenarios, all of
which I cover in this book.

Analyzing Data with Conditional
Formatting
Many Excel worksheets contain hundreds of data values. You could try to make
sense of such largish sets of data by creating complex formulas and wielding
Excel’s powerful data-analysis tools. However, just as you wouldn’t use a steamroller to crush a tin can, sometimes these sophisticated techniques are too much
tool for the job. For example, what if all you want are answers to simple questions
such as the following:


»» Which cell values are less than 0?
»» What are the top 10 values?
»» Which cell values are above average, and which are below average?
CHAPTER 1 Learning Basic Data-Analysis Techniques

9


×