Sei sulla pagina 1di 0

Managing &

Tabulating Data in
Excel





Learn the Power Features of Excel


Excel for Professionals 2002 VJ Books. All rights reside with the author.
Managing & Tabulating Data in Excel
2
M
M
M
a
a
a
n
n
n
a
a
a
g
g
g
i
i
i
n
n
n
g
g
g


&
&
&


T
T
T
a
a
a
b
b
b
u
u
u
l
l
l
a
a
a
t
t
t
i
i
i
n
n
n
g
g
g


D
D
D
a
a
a
t
t
t
a
a
a


i
i
i
n
n
n


E
E
E
x
x
x
c
c
c
e
e
e
l
l
l


Volume 4 of the series

E
E
E
x
x
x
c
c
c
e
e
e
l
l
l


f
f
f
o
o
o
r
r
r


P
P
P
r
r
r
o
o
o
f
f
f
e
e
e
s
s
s
s
s
s
i
i
i
o
o
o
n
n
n
a
a
a
l
l
l
s
s
s


Volume 1: Excel For Beginners
Volume 2: Charting in Excel
Volume 3: Excel-- Beyond The Basics
Volume 4: Managing & Tabulating Data in Excel
Volume 5: Statistical Analysis with Excel
Volume 6: Financial Analysis using Excel
Published by VJ

Books Inc
All rights reserved. No part of this book may be used or reproduced in any form or by
any means, or stored in a database or retrieval system, without prior written
permission of the publisher except in the case of brief quotations embodied in
reviews, articles, and research papers. Making copies of any part of this book for any
purpose other than personal use is a violation of United States and international
copyright laws.
First year of printing: 2002
Date of this copy: Monday, December 16, 2002
This book is sold as is, without warranty of any kind, either express or implied,
respecting the contents of this book, including but not limited to implied warranties
for the book's quality, performance, merchantability, or fitness for any particular
purpose. Neither the author, the publisher and its dealers, nor distributors shall be
liable to the purchaser or any other person or entity with respect to any liability, loss,
or damage caused or alleged to be caused directly or indirectly by the book.
This book is based on Excel versions 97 to XP. Excel, Microsoft Office, Microsoft
Word, and Microsoft Access are registered trademarks of Microsoft Corporation.
Publisher: VJ

Books Inc, Canada
Author: Vijay Gupta

3
A
A
A
B
B
B
O
O
O
U
U
U
T
T
T


T
T
T
H
H
H
E
E
E


A
A
A
U
U
U
T
T
T
H
H
H
O
O
O
R
R
R

Vijay Gupta has taught statistic, econometrics, and finance to institutions in
the US and abroad, specializing in teaching technical material to
professionals.
He has organized and held training workshops in the Middle East, Africa,
India, and the US. The clients include government agencies, financial
regulatory bodies, non-profit and private sector companies.
A Georgetown University graduate with a Masters degree in economics, he
has a vision of making the tools of econometrics and statistics easily
accessible to professionals and graduate students. His books on SPSS and
Regression Analysis have received rave reviews for making statistics and
SPSS so easy and non-mathematical. The books are in use by over 150,000
users in more than 140 nations.
He is a member of the American Statistics Association and the Society for
Risk Analysis.
In addition, he has assisted the World Bank and other organizations with
econometric analysis, survey design, design of international investments,
cost-benefit, and sensitivity analysis, development of risk management
strategies, database development, information system design and
implementation, and training and troubleshooting in several areas.
Vijay has worked on capital markets, labor policy design, oil research, trade,
currency markets, and other topics.
Managing & Tabulating Data in Excel
4
V
V
V
I
I
I
S
S
S
I
I
I
O
O
O
N
N
N


Vijay has a vision for software tools for Office Productivity and
Statistics. The current book is one of the first tools in stage one of his
vision. We now list the stages in his vision.
Stage one: Books to Teach Existing Software
He is currently working on books on word-processing, and report
production using Microsoft Word, and a booklet on Professional
Presentations.
The writing of the books is the first stage envisaged by Vijay for
improving efficiency and productivity across the world. This directly
leads to the second stage of his vision for productivity improvement
in offices worldwide.
Stage two: Improving on Existing Software
The next stage is the construction of software that will radically
improve the usability of current Office software.
Vijays first software is undergoing testing prior to its release in Jan
2003. The software titled Word Usability Enhancer will
revolutionize the way users interact with Microsoft Word, providing
users with a more intuitive interface, readily accessible tutorials, and
numerous timesaving and annoyance-removing macros and utilities.
He plans to create a similar tool for Microsoft Excel, and, depending
on resource constraints and demand, for PowerPoint, Star Office, etc.

5
Stage 3: Construction of the first feedback-designed Office and Statistics
software
Vijays eventual goal is the construction of productivity software
that will provide stiff competition to Microsoft Office. His hope is
that the success of the software tools and the books will convince
financiers to provide enough capital so that a successful software
development and marketing endeavor can take a chunk of the multi-
billion dollar Office Suite market.
Prior to the construction of the Office software, Vijay plans to
construct the Definitive statistics software. Years of working on
and teaching the current statistical software has made Vijay a
master at picking out the weaknesses, limitations, annoyances, and,
sometimes, pure inaccessibility of existing software. This 1.5 billion
dollar market needs a new visionary tool, one that is appealing and
inviting to users, and not forbidding, as are several of the current
software. Mr. Gupta wants to create integrated software that will
encompass the features of SPSS, STATA, LIMDEP, EViews,
STATISTICA, MINITAB, etc.
Other
He has plans for writing books on the learning process. The books
will teach how to understand ones approach to problem solving and
learning and provide methods for learning new techniques for self-
learning.



C
C
C
O
O
O
N
N
N
T
T
T
E
E
E
N
N
N
T
T
T
S
S
S

CHAPTER 1 SAVING (OPENING) IN (FROM) DIFFERENT FILE FORMATS 23
1.1 Spreadsheet, Database, Text & Statistical Software 23
Excel worksheet versions 2.0 to 4.0. 25
1.1.a Lotus 123 versions 1.0 to 4.0, Quattropro and dBase versions I to IV 26
1.1.b Text 26
1.1.c Many formats save only one worksheet 27
1.1.d Many formats cannot store information on cell formatting, comments, etc
27
1.1.e Statistical application files: SPSS, SAS, STATA, etc 28
1.1.f Database applications: Access, Oracle, MS SQL Server, FoxPro, Paradox,
other 28
1.2 Special Formats: Adobe PDF, Html, Web Archive, XML 28
1.3 Workspace I Have To Work On Several Files Together Each DayCan't I
Open Them All At One Time? 29
Creating a workspace 29
Using the workspace Opening several files together 30
1.4 New In The XP Version Of Excel: Document Recovery And Safe Mode 30
CHAPTER 2 DATA ENTRY FORM 33
2.1 An Easier Way To Type In Data Plus A Multi-Series Find Utility (Data /Form)
33
2.2 Form Based Data Entry 33
2.2.a New data 34
2.3 Using The Form As A Find Or Search Utility 34
A Summary Of The Two Roles Of Data/Form 38
CHAPTER 3 REDUCING ERRORS IN DATA ENTRY VALIDATION AND
AUTOCORRECT 40
3.1 Validating Data During Data-Entry 40
3.1.a Validation for numeric data 42
3.1.b Message shown to person entering the data into cells that have data
validation criteria 46
3.1.c Error Alert 47
3.1.d The validation rule in action 48
Contents
7
3.1.e Validation for text entry 50
3.1.f Testing the validation 52
3.1.g Ensuring that only a string from a set can be entered 52
3.2 Removing Validation Rules From A Range 55
3.3 Copying And Pasting Validation Rules 56
3.4 Selecting All Cells With The Same Data Validation Rule 56
3.5 Using Forms And Data Validation 56
3.6 Autocorrect 57
CHAPTER 4 USING FILL AND OTHER TOOLS TO SAVE ON TYPING TIME 59
4.1 Making Excel Fill In Numbers And Dates 60
4.1.a Filling years/integers 60
4.1.b Filling in every alternate year 62
4.2 Auto Fill Filling From Pre-Defined Lists Of Days, Months, Other 63
4.2.a Filling weekdays 66
4.3 Creating A New Custom List 67
4.4 Filling Missing Values 72
4.4.a Using constant increase in values 73
4.4.b Using constant growth rates 74
4.5 Filling Formats 76
4.6 Copying The Active Cell 76
4.7 Using A Right-Click-On-Mouse For Quick-Filling 76
4.8 Placing Data Entry Icons Onto The Toolbar 77
4.9 Speech To Text 78
CHAPTER 5 CONDITIONAL FORMATTING COLORCODING DATA PATTERNS
80
5.1 Understanding The Dialog 80
5.2 Defining The Condition 81
5.3 Step 1: Defining The Condition/Criteria 81
5.4 Step 2: Defining the format to use for Cells that satisfy the condition 82
5.5 Understanding The Conditional Format 84
Step 3: Adding more conditional formats 84
5.6 Defining A Dynamic Condition 85
5.7 Deleting Conditional Formats 87
5.8 Selecting All Cells With The Same Conditional Format Rule 87
Managing & Tabulating Data in Excel
8
CHAPTER 6 SORTING 89
6.1 Basic sorting 89
6.2 Names of series or columns 91
6.3 Case sensitivity 92
6.4 Sorting by rows 93
6.5 Sorting ranges that do not cover entire columns or rows 95
6.6 Choosing the entire worksheet 95
CHAPTER 7 FILTER (HIDING THE DATA YOU DO NOT WANT TO VIEW) 97
7.1 By one criterion on one column 98
7.1.a The Filtering arrows 99
7.1.b Choosing the value to use as the Filtering criterion 99
7.1.c The result: a Filtered worksheet 100
7.1.d Copying and pasting the Filtered rows 101
7.2 Removing the Filter 102
7.3 Custom Filtering using multiple criterion, logical conditions, etc 102
7.3.a Example of a Filter that has two criteria over one series/column 103
7.3.b Using the wildcard asterisk (*) 103
7.4 Filtering using criteria from more than one column/series 104
7.5 New in the XP version of Excel 107
7.6 Icons for Sorting and Filtering 107
CHAPTER 8 SELECTING ALL CELLS/CONTENT ACROSS THE WORKSHEET THAT
SATISFY A CRITERION 109
8.1 The GO TO option 109
8.1.a Selecting cells with comments, empty cells, unhidden cells, cells in the
contiguous region of the currently active cell 111
8.2 Conditional Formatting 112
8.3 Selecting based on Data Validation 113
8.4 Selecting based on formulae 114
8.4.a Constants 114
8.4.b Formula Results 115
8.5 Selecting based on cell references in formulas 116
8.5.a Selecting all cells whose formulas reference the active cell (directly or/and
indirectly) 116
8.5.b Selecting all cells referenced (directly or/and indirectly) by the formula in
the active cell 117
Contents
9
8.6 GO TO / SPECIAL as a search tool 118
CHAPTER 9 SUBTOTALS 119
9.1 Basics 119
9.2 Before making subtotals 120
9.3 Obtaining subtotals 120
9.3.a Choosing the subtotaling formula: average, sum, etc 122
9.4 Viewing only those rows that have subtotals 123
9.5 Removing subtotals 123
9.6 The Consolidation tool 124
CHAPTER 10 PIVOT REPORTS 126
10.1 The four steps in making a two-dimensional Pivot Report 127
10.1.a Step 1: Opening the Pivot Report wizard 128
10.1.b Step 2: Choosing the data for tabulation 130
10.1.c Step 3a: Designing the Pivot Report 131
10.1.d Step 3b: Choosing the formula for aggregation/tabulation 133
10.1.e Step 4a: Options 135
Format options: 137
Data options 138
External data options 138
10.1.f Step 4b: Wrapping it up creating the Pivot Report 139
10.2 Modifying/editing a Pivot Report 140
10.2.a Modifying the structure of a Pivot Report 142
10.2.b Adding a new function (and thus a new row series) 143
10.2.c Editing fields 148
Selecting a field 148
Viewing the options available for modifying/editing a field 149
10.2.d Deleting a field 152
10.3 Refreshing the Report 152
10.4 Pivot Report example with a third dimension (row, column and page) 152
10.4.a Viewing different pages 154
10.4.b Making a new worksheet for each page 155
10.4.c Making a new chart for each page 156
10.5 Pivot reports from Scenarios 156
10.6 OLAP: New feature in the XP version of Excel 157
10.7 Icons for Pivoting 157
CHAPTER 11 IF-THEN ANALYSIS: SCENARIOS AND GOAL SEEK 159
Managing & Tabulating Data in Excel
10
11.1 Scenarios (for If this assumption-then this result) 159
11.1.a Defining the Scenarios 160
Using the Scenarios 163
Scenario summary 164
Using the Group and Outline tool 166
Scenario-based Pivot Tables 168
11.2 Goal Seek (If I want this cell to have a certain result, what value should that cell
take) 170
11.2.a Setting the desired value for the target cell (the one with the formula
that references the solution cell) 171
11.2.b Choosing the solution cell 171
Running the utility 172
CHAPTER 12 LINKING TO A DATABASE 174
Important definition: Query 175
12.1 Understanding the structure of a database file 176
Analogy between the structures of a database file and an Excel file 177
12.2 Linking to data from a database (or, creating and executing a data query) 177
12.2.a Step 1: Choosing the Database File from which data will be imported 178
12.2.b Step 2: Choosing the Columns/Fields/Variables to Import 180
Selecting fields for import into Excel 182
12.2.c Step 3: (Pre) Filtering the data to be imported 184
12.2.d Step 4: Presorting the data to be imported 190
12.2.e Step 5: Saving the Query (that is, saving steps 14) 191
12.2.f Step 6: Wrapping it up getting the data into Excel 192
12.3 Refreshing the link between the Excel range and data in the database file 193
12.4 Editing an existing query 194
12.5 Using External data source to create a Pivot Report 195
12.6 New in the XP version of Excel: OLAP 195
12.6.a Data from the Internet 195
12.7 Icons relevant to External Data 195
CHAPTER 13 READING ASCII TEXT DATA 198
13.1 Understanding ASCII Text data 199
Why is data stored and distributed in this format? 199
What is special about this format? 199
Fixedwidth/Column 200
Delimited/Free-Field 201
13.2 Reading delimited/Free-Field ASCII Text data 201
13.2.a Step 1: Choosing whether the format is delimited or Fixed-width 202
13.2.b Step 2: Choosing the correct Delimiter: tab, comma, space, etc 204
Determining if Excel or you have chosen the wrong Delimiter 205
Contents
11
13.2.c Step 3: Define the data formats (if not done automatically/correctly by
Excel) 206
13.2.d Converting into an Excel file 208
13.3 Reading Fixed-width ASCII TEXT 209
CHAPTER 14 PASTE SPECIAL 215
14.1 Pasting The Result Of A Formula, But Not The Formula 216
14.2 Other Selective Pasting Options 218
14.2.a Pasting only the formula (but not the formatting and comments) 218
14.2.b Pasting only formats 218
14.2.c Pasting data validation schemes 219
14.2.d Pasting all but the borders 219
14.2.e Pasting comments only 219
14.3 Performing An Algebraic Operation When Pasting One Column/Row/Range On
To Another 220
14.3.a Multiplying/dividing/subtracting/adding all cells in a range by a number
220
14.3.b Multiplying/dividing the cell values in cells in several pasted on
columns with the values of the copied range 221
14.4 Switching Rows To Columns 221
CHAPTER 15 SAVING OR TRANSFORMING TO SPECIAL WEB AND DOCUMENT
FORMATS 223
15.1 Converting to a PDF (Adobe Acrobat) file 223
15.1.a Creating a PDF (Adobe Acrobat) file from the printout 224
15.1.b Other tools for converting one or multiple files into PDF 226
15.2 Saving as an HTML file 226
15.2.a Interactivity when saving a worksheet 227
15.2.b Interactivity when saving a chart 229
15.3 New in the XP version of Excel: Web Archive format and XML 231
15.3.a Web Archive 231
15.3.b XML 237
INDEX 237

Managing & Tabulating Data in Excel
12
Mapping of menu options with sections of the book
and in the series of books
You may be looking for a section that pertains to a particular menu option
in Excel. I now briefly lay out where to find (in the series) a discussion of
a specific menu option of Excel.
Table 1: Mapping of the options in the FILE menu
Menu Option Section that discusses the option
OPEN
SAVE
SAVE AS
chapter 1
Volume 1: Excel For Beginners
SAVE AS WEB PAGE 15.2
SAVE WORKSPACE 1.3
SEARCH Volume 1: Excel For Beginners
PAGE SETUP Volume 1: Excel For Beginners
PRINT AREA Volume 1: Excel For Beginners
PRINT PREVIEW Volume 1: Excel For Beginners
PRINT
Volume 1: Excel For Beginners
PROPERTIES Volume 1: Excel For Beginners
Table 2: Mapping of the options in the EDIT menu
Menu Option Section that discusses the option
UNDO Volume 1: Excel For Beginners
REDO Volume 1: Excel For Beginners
Contents
13
Menu Option Section that discusses the option
CUT
COPY
PASTE
Various

OFFICE CLIPBOARD Volume 1: Excel For Beginners
PASTE SPECIAL
Volume 3: Excel Beyond The Basics
FILL chapter 4
CLEAR Volume 1: Excel For Beginners
DELETE SHEET Volume 1: Excel For Beginners
MOVE OR COPY SHEET Volume 1: Excel For Beginners
FIND Volume 1: Excel For Beginners
REPLACE Volume 1: Excel For Beginners
GO TO
Volume 3: Excel Beyond The Basics
LINKS
Volume 3: Excel Beyond The Basics
OBJECT
Volume 3: Excel Beyond The Basics
Volume 2: Charting in Excel
Table 3: Mapping of the options in the VIEW menu
Menu Option Section that discusses the option
NORMAL
Volume 1: Excel For Beginners
PAGE BREAK PREVIEW Volume 1: Excel For Beginners
TASK PANE
Volume 1: Excel For Beginners
TOOLBARS
Volume 1: Excel For Beginners
Volume 3: Excel Beyond The Basics
Managing & Tabulating Data in Excel
14
Menu Option Section that discusses the option
FORMULA BAR
Leave it on (checked)
STATUS BAR
Leave it on (checked)
HEADER AND FOOTER Volume 1: Excel For Beginners
COMMENTS
Volume 3: Excel Beyond The Basics
FULL SCREEN
Volume 1: Excel For Beginners
ZOOM Volume 1: Excel For Beginners
Table 4: Mapping of the options in the INSERT menu
Menu Option Section that discusses the option
CELLS Volume 1: Excel For Beginners
ROWS Volume 1: Excel For Beginners
COLUMNS Volume 1: Excel For Beginners
WORKSHEETS Volume 1: Excel For Beginners
CHARTS
Volume 2: Charting in Excel
PAGE BREAK Volume 1: Excel For Beginners
FUNCTION
Volume 1: Excel For Beginners
Volume 3: Excel Beyond The Basics
Volume 5: Statistical Analysis with Excel
Volume 6: Financial Analysis using Excel
FUNCTION/FINANCIAL Volume 6: Financial Analysis using Excel
FUNCTION/STATISTICAL
Volume 5: Statistical Analysis with Excel
FUNCTION/LOGICAL
Volume 3: Excel Beyond The Basics
FUNCTION/TEXT
Volume 3: Excel Beyond The Basics
Contents
15
Menu Option Section that discusses the option
FUNCTION/INFORMATION
Volume 3: Excel Beyond The Basics
FUNCTION/LOOKUP
Volume 3: Excel Beyond The Basics
FUNCTION/MATH & TRIG
Volume 3: Excel Beyond The Basics
FUNCTION/ENGINEERING
Volume 3: Excel Beyond The Basics
FUNCTION/DATABASE Volume 3: Excel Beyond The Basics
FUNCTION/DATE & TIME
Volume 1: Excel For Beginners
Volume 5: Statistical Analysis with Excel
Volume 6: Financial Analysis using Excel
NAME
Volume 1: Excel For Beginners
COMMENT
Volume 3: Excel Beyond The Basics
PICTURE
Volume 2: Charting in Excel
DIAGRAM
Volume 2: Charting in Excel
OBJECT
Volume 3: Excel Beyond The Basics
HYPERLINK
Volume 3: Excel Beyond The Basics
Table 5: Mapping of the options inside the FORMAT menu
Menu Option Section that discusses the option
CELLS
Volume 1: Excel For Beginners
ROW
Volume 1: Excel For Beginners
COLUMN
Volume 1: Excel For Beginners
SHEET
Volume 1: Excel For Beginners
AUTOFORMAT
Volume 1: Excel For Beginners
Managing & Tabulating Data in Excel
16
Menu Option Section that discusses the option
CONDITIONAL FORMATTING chapter 5
STYLE
Volume 1: Excel For Beginners
Table 6: Mapping of the options inside the TOOLS menu
Menu Option Section that discusses the option
SPELLING
Volume 1: Excel For Beginners
ERROR CHECKING
Volume 3: Excel Beyond The Basics
SPEECH 4.9
SHARE WORKBOOK Volume 3: Excel Beyond The Basics
TRACK CHANGES
Volume 3: Excel Beyond The Basics
PROTECTION Volume 3: Excel Beyond The Basics
ONLINE
COLLABORATION
Volume 3: Excel Beyond The Basics
GOAL SEEK
Volume 3: Excel Beyond The Basics
SCENARIOS
Volume 5: Statistical Analysis with Excel
Volume 6: Financial Analysis using Excel
AUDITING Volume 3: Excel Beyond The Basics
TOOLS ON THE WEB
The option will take you to a Microsoft site that
provides access to resources for Excel
MACROS
In upcoming book on Macros for Microsoft
Office
ADD-INS
Volume 3: Excel Beyond The Basics
Volume 5: Statistical Analysis with Excel
AUTOCORRECT Volume 3: Excel Beyond The Basics
CUSTOMIZE Volume 3: Excel Beyond The Basics
Contents
17
Menu Option Section that discusses the option
OPTIONS
Volume 1: Excel For Beginners
Table 7: Mapping of the options inside the DATA menu
Menu Option Section that discusses the option
SORT chapter 6
FILTER chapter 7
FORM chapter 2
SUBTOTALS chapter 9
VALIDATION chapter 3
TABLE Volume 3: Excel Beyond The Basics
CONSOLIDATION section 48.5
GROUP AND OUTLINE
Volume 1: Excel For Beginners
PIVOT REPORT chapter 10
EXTERNAL DATA chapter 12
Table 8: Mapping of the options inside the WINDOW menu
Menu Option Section that discusses the option
HIDE Volume 3: Excel Beyond The Basics
SPLIT Volume 1: Excel For Beginners
FREEZE PANES Volume 1: Excel For Beginners
Managing & Tabulating Data in Excel
18

Table 9: Mapping of the options inside the HELP menu
Menu Option Section that discusses the option
OFFICE ASSISTANT Volume 1: Excel For Beginners
HELP Volume 1: Excel For Beginners
WHATS THIS Volume 1: Excel For Beginners

I NTRODUCTI ON
Are there not enough Excel books in the market? I have asked myself this
question and concluded that there are books inside me, based on what I
have realized from observation by friends, students, and colleagues that I
have a vision and knack for explaining technical material in plain
English.
Read the book practicing the lessons on the sample files provided in the
zipped file you downloaded. I hope the book is useful and assists you in
increasing your productivity in Excel usage. You may be pleasantly
surprised at some of the features shown here. They will enable you to
save time.
The Make me a Guru series teach technical material in simple English.
A lot of thinking went into the sequencing of chapters and sections. The
book is broken down into logical functional components. Chapters are
organized into sections and sub-sections. This creates a smooth flowing
structure, enabling total immersion learning. The current series is
broken down into a multi-level hierarchy:
Contents
19
Chapters, each teaching a specific skill/tool.
Several sections within each chapter. Each section shows aspect of
the skill/tool taught in the chapter. Each section is numberedfor
example, Section 1.2 is the numbering for the second section in
chapter 1.
A few sub-sections (and maybe one further segmentation) within
each section. Each sub-section lists a specific function, task, or
proviso related to the master section. The sub-sections are
numberedfor example, 1.2.a for the first sub-section in the
second section of chapter 1.
Unlike other publishers, I do not consider you dummies or idiots. Each
and everyone had the God given potential to achieve mastery in any field.
All one needs is a guide to show you the way to master a field. I hope to
play this role. I am confident that you will consider your self an Excel
Guru (in terms of the typical use of Excel in your profession) and so will
others.
Once you learn the way to master a windows application, this new
approach will enable you to pick up new skills on the fly. Do not argue
for your limitations. You have none.
I hope you have a great experience in learning with this book. I would
love feedback. Please use the feedback form on our website vjbooks.net.
In addition, look for updates and sign up for an infrequent newsletter at
the site.
MANAGING & TABULATING DATA
Excel has extremely powerful data entry, data management, and
tabulation tools. The combination of tools provide almost database like
Managing & Tabulating Data in Excel
20
power to Excel. Unfortunately, the poor quality of the menu layout and
the help preclude the possibility of the user self-learning these features.
BASICS
The fundamental operations in Excel are taught in Volume 1: Excel For
Beginners, Volume 2: Charting in Excel, and Volume 3: Excel Beyond The
Basics
FUNCTIONS
I teach the writing of formulas and associated topics in Volume 3: Excel
Beyond The Basics. I show, in a step-by-step exposition, the proper way
for writing cell references in a formula. The book describe tricks for
copying/cutting and pasting in several examples. In addition, I discuss
special pasting options.
Finally, different types of functions are classified under logical categories
and discussed within the optimal category. The categories include
financial, Statistical, Text, Information, Logical, and Smart Logical.
FINANCE
In three chapters on financial functions, I list the functions used for
estimating loan repayments (for example, like a car loan or house
mortgage), discount cash flow analysis (used often for estimating the
returns and present values of multi-period investment projects), and
parameters associated with securities market instruments like bonds and
T-bills.
If your interest is Investment Banking or Feasibility Studies (Project
Contents
21
Finance), you should learn Scenarios, the Solver utility, and Goal Seek.
With Scenarios, you can perform basic risk analysis.
STATISTICS PROCEDURES
Three chapters teach statistics functions including the use of Excel
functions for building Confidence Intervals and conducting Hypothesis
Testing for several types of distributions. The design of hypothesis tests
and the intermediate step of demarcating critical regions are taught
lucidly.
CHARTING
Please refer to book two in this series. The book title is Charting in Excel.
Sample data
All the sample data files are included in the zipped file.
I have not included the dat set for conducting statistical procedures. This
is intentional; often, readers fail to internalize the few key concepts of
hypothesis testing because they do not subject themselves to a sink-or-
swim inference-drawing thinking and imbibing process when
interpreting the results of statistical procedures.
Sample data
Most of the tutorials use publicly available data from the International
labor Organization (ILO). I used a simple data set with only a few
columns and observations. All the sample data files are included in the
zipped file.


Saving or transforming to special web and document formats
23
CHAPTER 1

SAVING (OPENING) IN (FROM)
DIFFERENT FILE FORMATS
In this chapter, I briefly discuss the following topics:
SAVING/OPENING TO/FROM FILE FORMATS LIKE LOTUS 1
23 VERSIONS 1.0 TO 4.0, QUATTROPRO AND DBASE
VERSIONS I TO IV, TEXT.
STATISTICAL APPLICATION FILES: SPSS, SAS, STATA, ETC
DATABASE APPLICATIONS: ACCESS, ORACLE, MS SQL
SERVER, FOXPRO, PARADOX, OTHER
WORKSPACE I HAVE TO WORK ON SEVERAL FILES
TOGETHER EACH DAYCAN'T I OPEN THEM ALL AT
ONE TIME?
USING THE WORKSPACE OPENING SEVERAL FILES
TOGETHER
NEW IN EXCEL XP: DOCUMENT RECOVERY AND SAFE MODE
1.1 SPREADSHEET, DATABASE, TEXT & STATISTICAL
SOFTWARE
Excel XP, 2000, and 97 can open files from various file formats, including:
Current and older versions of Excel workbooks
Managing & Tabulating Data in Excel
24
Older versions of Excel workbooks
Other spreadsheet applications like Lotus 123, Quattropro, and
Microsoft Works. This includes older versions of these file
formats.
Text files (delimited and fixed column width see chapter 13 on
page 198)
Web pages
Database applications like Access, Paradox, dBase, etc. This
includes older versions of these file formats. The use of ODBC
connectivity (direct linking to a database with automatic
updating) is taught in chapter 12 on page 174.
Special data or reference storing formats like .dif and .slk.
Excel cannot read directly from statistical software like SAS, SPSS, and
STATA. These statistical applications provide an option to output data
files in Excel format.
Using the mouse, select the menu path FILE/OPEN or FILE/SAVE AS
and click on the arrow next to the box Open as type or Save as type as
shown in the next figure.
You will see several options for the file type from which Excel will read in
data (and to which Excel will save data). Several of the formats are
historical versions of Excel.
Saving or transforming to special web and document formats
25
Figure 1: The FILE/OPEN or FILE/SAVE AS dialog (user-input form)

Excel worksheet versions 2.0 to 4.0.
If the option includes the text Excel worksheet then only the active
worksheet is saved. This is useful if you want to read Excel files into
software like SPSS, SAS and other applications that do not read Excel
workbooks but do read Excel worksheets.
Figure 2: Old Excel formats

Managing & Tabulating Data in Excel
26
1.1.A LOTUS 123 VERSIONS 1.0 TO 4.0, QUATTROPRO AND DBASE
VERSIONS I TO IV
You can save as a Lotus 123 workbook (versions WK4 to WK1) and as
different versions of Quattropro. Older spreadsheet formats save only the
active worksheet.
Figure 3: Lotus 123 formats

dBase IIIV are excellent transport formats. Almost all data
applications read these formats.
The applications that read dBase include SAS, SPSS, STATA, Access, and
many other data warehousing and data mining software.
Figure 4: Quattropro and the popular dBase formats

1.1.B TEXT
Different text formats include cross platform support in Windows,
saving an Excel file as a text file will allow the file to be read in DOS or
the Mac). The process of reading data from such files is taught in chapter
13.
Saving or transforming to special web and document formats
27
Figure 5: Some special data formats (you can ignore these)

Figure 6: Text formats

1.1.C MANY FORMATS SAVE ONLY ONE WORKSHEET
Older spreadsheet formats, database and text formats will save only the
active worksheet. Excel will inform you of this (as shown in the next
figure) and give you the option of canceling the save task.
1.1.D MANY FORMATS CANNOT STORE INFORMATION ON CELL
FORMATTING, COMMENTS, ETC
Excel will inform you if the file-format you are saving will save all
attributes of the worksheet/workbook.
In most cases, the attributes that cannot be saved are cosmetic formatting
features and embedded objects like charts, drawing tools, etc.
Managing & Tabulating Data in Excel
28
Figure 7: Some formats save only raw data

1.1.E STATISTICAL APPLICATION FILES: SPSS, SAS, STATA, ETC
Most of these applications will read and write some formats that Excel
can read/write. These formats include Excel 4 worksheet and dBase III.
1.1.F DATABASE APPLICATIONS: ACCESS, ORACLE, MS SQL SERVER,
FOXPRO, PARADOX, OTHER
Most of these applications will read and write some formats that Excel
can read/write. These formats include Excel 4 worksheet and dBase III.
1.2 SPECIAL FORMATS: ADOBE PDF, HTML, WEB
ARCHIVE, XML
This topic is taught in chapter 15.
Saving or transforming to special web and document formats
29
1.3 WORKSPACE I HAVE TO WORK ON SEVERAL
FILES TOGETHER EACH DAYCAN' T I OPEN THEM
ALL AT ONE TIME?
Assume you are working on a project in which you use 12 files. Further,
these files are saved in different drives/directories or paths. (So, some are
in C:\data\, some in M:\projects\ttvgr\vijay\, and so on.) Assume
further that you have to open all files simultaneously before doing any
work. This can be achieved by, either (a) writing all the file names along
with their path (location), or (b), using the Workspace feature.
Creating a workspace
Assume the 12 files you need for one work session are open (and no other
files are open). Select the option FILE/SAVE WORKSPACE. Write a
name for this group of files you have been working on (see Figure 8).
Click on the button Save.
Figure 8: Saving links to all open Excel files as one Workspace

Managing & Tabulating Data in Excel
30
Using the workspace Opening several files together
When you want to work on the group of files again open Excel, pick the
menu option FILE/OPEN and open the workspace file as shown in Figure
9. The 12 Excel files you were working on earlier open!
Figure 9: When you open the Workspace, Excel opens all the Excel files that were open when
you last saved the Workspace

1.4 NEW IN THE XP VERSION OF EXCEL: DOCUMENT
RECOVERY AND SAFE MODE
The document recovery feature is excellent in the XP version of Excel. If
the application freezes/crashes, the PC crashes, or you lose connection to a
power source, the chances of losing the work you did on the file since the
last save is low. Excel keeps a tab on your changes and creates a recovery
backup continuously. On re-launching Excel, the recovery files are
Saving or transforming to special web and document formats
31
displayed in the task pane, as well as the last saved files, along with the
times and dates of these files last save (by you or by Excels document
recovery tool). You can choose which version(s) to save.
A related feature is the ability to open an application in Safe Mode, and
resolve the problems with the application using this mode.


Data Entry Form
33
CHAPTER 2

DATA ENTRY FORM
This chapter teaches the following topics:
AN EASIER WAY TO TYPE IN DATA PLUS A MULTI-SERIES
FIND (DATA /FORM)
FORM BASED DATA ENTRY
NEW DATA
USING THE FEATURE AS A FIND SEARCH
2.1 AN EASIER WAY TO TYPE IN DATA PLUS A MULTI-
SERIES FIND UTILITY (DATA /FORM)
Assume you have to type in data for a few series. You find typing on the
worksheet directly to be a pain. An easier way is to use a form. Use the
sample file Advanced Files1.xls.
2.2 FORM BASED DATA ENTRY
First, in the first rows of consecutive columns, enter the title for the series
in that column (as in the sample file).
Managing & Tabulating Data in Excel
34
Using the mouse, select the menu path DATA/FORM. You will see a
form for entering the data. (For a pictorial reproduction, see Figure 10.)
Excel has automatically picked up the Series Names from the first row.
(The series on the worksheet are named Series Name, Country Name,
1995, 2000 and 2010).
2.2.A NEW DATA
You can enter the data for a new case/row by clicking on New and typing
in the data for the first series, pressing the TAB and then entering the
data for the next series and so on. Delete will delete an entire row.
Figure 10: The form for data entry

2.3 USING THE FORM AS A FIND OR SEARCH
UTILITY
An additional advantage of the DATA/FORM feature is that it is also a
powerful find facility. Click on the button Criteria.
Data Entry Form
35
Figure 11: Using the Criteria option to make the data entry form into a data search form

After you click on Criteria, the dialog (user-input form) shown in Figure
12 opens. Compare that dialog with the dialog shown in the previous
figure.
Note that the buttons on the right half of the dialog have changed. The
button New is unavailable and there is no Delete button. The button
Clear replaces Delete. Use Clear for removing all the conditions in the
Criteria dialog. The button Form switches to the data entry form dialog.
Managing & Tabulating Data in Excel
36
Figure 12: The Criteria dialog. Note the title Criteria at the top-right.

Enter the criterion for finding data. (For a pictorial reproduction, see
Figure 13.)
Figure 13: A multiple series criteria for finding data

Clicking on the button Clear will remove all criteria while clicking on
the button Restore will restore the defaults. In addition, in general,
when in the Find or Criteria facility, you return to the Form facility
for data entry by clicking on the button Form.
Now, when you click on the button Find Next you will be taken to the
Data Entry Form
37
next row/case in which the country name is Algeria, the values of the data
for 1995, 2000, and 2010 are greater than 10000, 15000 and 17000,
respectively. (For a pictorial reproduction, see Figure 15.)
Figure 14: Use the Find Next button to locate the next observation (row) whose data
satisfies the criteria.

Figure 15: After clicking on the button Find Next you will see the next row/case that
satisfies all four conditions of the criteria

Managing & Tabulating Data in Excel
38
Note that you are back in the Form facility.
A Summary Of The Two Roles Of Data/Form
Role Function
Special
Buttons/options
Common buttons
Form
facility
Enabling data entry,
editing of existing
data, deletion or
addition of rows
New: allows data
entry for a new row
Delete: deletes the
current row
Criteria: switches to
the Criteria or
Find facility
Find next, Find
previous: the criteria
is defined using the
Find or Criteria
facility
Find or
Criteria
facility
Finding rows that
meet a set of criteria
based on the same
series as in the form
facility. (Note that the
Left hand side series
labels are same for
both)
Clear: removes all
the criteria
Restore: Form:
switches to the
Form facility for
data entry
Find next, Find
previous:
automatically
reverts dialog back
to the Form data
entry facility




Managing & Tabulating Data in Excel
40
CHAPTER 3

REDUCING ERRORS IN DATA
ENTRY VALIDATION AND
AUTOCORRECT
This chapter teaches the following topics:
VALIDATION FOR NUMERIC DATA
MESSAGE SHOWN TO PERSON ENTERING THE DATA INTO
CELLS THAT HAVE DATA VALIDATION
ERROR ALERT
THE VALIDATION RULE IN ACTION
VALIDATION FOR TEXT ENTRY
TESTING THE VALIDATION
ENSURING THAT ONLY A STRING FROM A SET CAN BE
ENTERED
REMOVING VALIDATION RULES FROM A RANGE
COPYING AND PASTING VALIDATION RULES
USING FORMS AND DATA VALIDATION
3.1 VALIDATING DATA DURING DATA- ENTRY
If you are typing data straight into Excel, you may want to take steps to
Reducing Errors in Data Entry Validation & Autocorrect
41
reduce the chance of making typing errors. For a small amount of data, a
visual scan after data entry may suffice as a data validation technique.
However, when the amount of data is large and/or you want to ensure
that invalid data is not entered in a cell, then you should use the option
DATA/VALIDATION.
Open a new Excel file. Assume you want to enter data into three
columns:
In column F, a series of numbers
In column G, a series of text entries
In column H, the appropriate country name from a list you have
Further, assume you want the data to satisfy the following validation
rules or criteria:
1. The data in column F must be in number format and larger than
12,000,000 (or a blank or empty cell). If, while typing in the
data, any value is entered that does not satisfy these criteria,
then Excel should give me a warning. Read page 42 for the way
to ensure that these criteria are set.
2. The data in column G must be in text format and cannot be of a
length longer than eight letters (this includes any spaces). Read
page 50 for the way to ensure that these criteria are set.
3. The data in column H can only be one of the values in a chosen
set of cells. Read page 52 for the way to ensure that this
criterion is set.
Managing & Tabulating Data in Excel
42
3.1.A VALIDATION FOR NUMERIC DATA
Select cell F1 and type in a title for the data that will be typed into this
column. The next figure illustrates this.
Figure 16: Write the label

Click on the letter F at the top of the spreadsheet so that the entire
column F is selected/highlighted. (Alternatively, use the mouse to select
a limited range like F1:F81.)
Access the feature through the menu path DATA/VALIDATION. Click on
the tab Settings.
Figure 17: The Data Validation dialog (user-input form)

Setting the first validation rule
In the area Allow choose the option Whole Number. The next figure
illustrates this. You have set the first validation rule: any data entered
in column F must be a whole number; the data cannot be text, dates,
numbers with decimals, etc.
Reducing Errors in Data Entry Validation & Autocorrect
43
Figure 18: Setting the Validation Criteria

When you click on the option Whole Number, the dialog (user-input
form) will change and include new boxes that are relevant for writing
validation rules for whole numbers. (For a pictorial reproduction, see
Figure 19.) These rules typically are of the type less than, equal to,
greater than, etc.
Figure 19: Setting a Validation Criteria that will only permit the entry of Whole Numbers
into the underlying column/range

Managing & Tabulating Data in Excel
44
Setting the second validation rule
Now you have to set the second validation rule: any data entered in
column F cannot have a value that is greater than 120000, unless it is a
blank/empty cell.
Step 1: Click on the downward arrow next to the box Data
1
. The next
figure illustrates this. In the area Data, choose the comparison option
greater than or equal to as shown in Figure 20.
Because you have chosen Greater than or equal to, the dialog has
modified and now no longer has a box for Maximum
2
! (For obvious
reasons, that box is useless if you are looking for numbers Greater than
or equal to!)

1
Excel has dynamic menus. The dialog adapts and changes once you choose a
validation rule in the area Allow. Excel knows the variable has to a whole number.
The relevant additional criteria have to be based on this logic. Therefore, Excel
shows Data, Minimum and Maximum. Compare with the options shown in the
dialog when your validation rules are for text data (see Figure 102 on page 51) and
for a defined list (see Figure 107 on page 53).
2
As mentioned in the previous footnote, Excel has dynamic menus and dialogs. The
dialog adapts and changes once you choose a comparison operator / rule in the area
Data. Try different options.
Reducing Errors in Data Entry Validation & Autocorrect
45
Figure 20: Defining the Criteria

Step 2: Enter the second validation rule into this box as shown in Figure
21.
Allowing empty cells (that is, data points)
Select the option Ignore blank.
You have defined the validation rule for column F.
Figure 21: The completed Validation Criteria

Nevertheless, do not click as yet on the button OK!
Next, you need to ensure that the rule does its job of precluding the input
of invalid data. For that, you use an input message and an error alert.
The former informs the person entering data into a cell about any
Managing & Tabulating Data in Excel
46
validation rule that governs the set of acceptable data in that cell. The
latter gives an error alert warning if inappropriate data/text is entered
into a cell that has validation criteria. Excel will not permit any invalid
data. I now show how to use these two methods.
3.1.B MESSAGE SHOWN TO PERSON ENTERING THE DATA INTO
CELLS THAT HAVE DATA VALIDATION CRITERIA
Within the DATA/VALIDATION dialog, click on the tab Input
Messages.
Enter a short title and an Input message this message will pop-up and
inform the person entering data into column F that the data has to
follow the rules mentioned in the message. (See two figures down to view
what the message box will look like in action.)
When the cursor is over any cell in column F, this message will be
displayed. The message should provide information on the validation
rule.
Reducing Errors in Data Entry Validation & Autocorrect
47
Figure 22: Entering text that will be seen when a person enters data into any cell within the
range that has a validation criterion

3.1.C ERROR ALERT
Even more important than the Input Message tab is the Error Alert
tab. The title and message you write here will inform the person typing
the data if a data value entered did not satisfy the criteria set by your
validation rules. (I will show some examples.)
Figure 23: Enter the text that should be shown if invalid data is entered into any cell in a
range that has validation criteria for data entry

Managing & Tabulating Data in Excel
48
Now you can execute the dialog by clicking on the button OK. The
validation rules, and accompanying input message and error alert have
been set for column F.
3.1.D THE VALIDATION RULE IN ACTION
Click in cell F2. Even before you start entering any data/text into the cell,
Excel displays the Input Message as a pop-up text-box. This message
reminds you about the validation rule.
Figure 24: The Input Message in practice

Type a valid number in cell F2, and leave F3 blank
(which conforms to our validation rule).
Enter another valid number in cell F4.
Figure 25: Try this example

Assume that In cell F5 you make a mistake in typing. Notice the letter
Reducing Errors in Data Entry Validation & Autocorrect
49
w the addition of this letter makes the entire cell text data and not
a whole number as required by the validation rules.
Figure 26: On entering invalid data..(see next figure)

When you push down the ENTER key the error message you wrote earlier
(for an illustration of this, see Figure 23 on page 47) is displayed in a
dialog (user-input form.)
Figure 27: The Error Alert is displayed

Click on Retry and enter a valid number.
Reminder:
The Validation Rule for column F is must be in number format and
larger than 12,000,000 (or a blank or empty cell).
Figure 28: After choosing Retry and entering in valid data, no Error Alert is displayed

Managing & Tabulating Data in Excel
50
In cell F6, type a value that was a Whole Number but below the minimum
acceptable whole number. You are warned/informed about the mistake.
For an illustration of the warning, refer to the figure below.
Figure 29: Another example of attempting to enter invalid data results in(see next figure)

This entry is not valid because it is less than the minimum acceptable
valid value in the cell 12000000. Excel displays the Error Alert
warning. Click on Retry and enter a valid number.
Figure 30: The Error Alert being displayed

3.1.E VALIDATION FOR TEXT ENTRY
For textual data, you can set the rules for the length of the cell entry.
Choose cell G1 and enter a name for the series.
Step 1:
Highlight the column G. In the area Allow choose the option Text
Length. You have set the first validation rule.
Reducing Errors in Data Entry Validation & Autocorrect
51
Step 2: Choose a Maximum text length of 8. The second validation
rule is defined.
Figure 31: Validation Criteria allowing only text of certain length

Click on the tab Input Message and type in an appropriate message.
Click on the tab Error Alert and write a message that will display
whenever invalid data is entered. (As you did in the previous example).
Execute the dialog by clicking on the button OK.
Figure 32: Always enter an Error Alert that describes the valid criteria

Managing & Tabulating Data in Excel
52
3.1.F TESTING THE VALIDATION
Write the text Vijay Gupta into cell G2. The length of this entry is 11
(10 letters plus 1 blank space) implying that the entry is invalid.
Figure 33: On entering invalid data...(see next figure)

The entry is invalid and an error message is displayed. The next figure
reproduces this message.
Figure 34: .an Error Alert is displayed. Note that this alert mentions the valid criteria.

3.1.G ENSURING THAT ONLY A STRING FROM A SET CAN BE
ENTERED
Choose cell H1 and enter a name for the series.
Figure 35: Key (Type)-in the label

Select the entire column H and go to DATA/VALIDATION. Within the
Reducing Errors in Data Entry Validation & Autocorrect
53
dialog (user-input form) that opens, choose the option List in the area
Allow. (For a pictorial reproduction, see Figure 36 below.)
Figure 36: Ensuring that the data is only valid if it belongs to a list of possible values

The List is a set of possible values that the cells in column H can take.
The cells cannot have any other values.
Assume that the list you want to use is the list of country names; it is in
the range B2 to B17.
Click on the right edge of the white text-box Source and click on the
range B2 to B17. The dialog should look like the one in Figure 37.
Managing & Tabulating Data in Excel
54
Figure 37: The List Validation Criteria is defined

Click on the tab Error Alert and type in a message that you want
displayed when incorrect data is entered. Execute the dialog by clicking
on the button OK.
Figure 38: Make sure that the Error Alert provides the valid criteria in the error message

Choose cell H2. When you click on it, you will see a downward arrow at
the edge of the cell. Click on the arrow and the entire list of countries is
displayed! Instead of typing in a country name, you can just choose it
from the list. Therefore, apart from reducing chances of mistakes in data
entry, it also saves on typing time.
Reducing Errors in Data Entry Validation & Autocorrect
55
Figure 39: Using the List Validation Criteria can save on typing

Figure 40: Selecting a valid value from the valid list

3.2 REMOVING VALIDATION RULES FROM A RANGE
Highlight the range from which you want to remove the validation
settings. (The range may be a subset of the entire range for which you
had set the validation rule.) Choose the menu option
DATA/VALIDATION and click on the button Clear All. The next figure
illustrates this.
Figure 41: Removing Validation Rules from a range

Managing & Tabulating Data in Excel
56
3.3 COPYING AND PASTING VALIDATION RULES
In the situation that requires the same validation rules for ranges in
many worksheets/files, you can save time by copying and pasting the
validation rules.
First, select the cells that have the validation rules you want to use as the
model. Go to EDIT / COPY. Select the range on which you want to
impose the validation rules. Go to EDIT/PASTE SPECIAL and choose
the option Validation in the area Paste. See Volume 3: Excel Beyond
The Basics for more on pasting validation rules.
3.4 SELECTING ALL CELLS WITH THE SAME DATA
VALIDATION RULE
Refer to Volume 3: Excel Beyond The Basics.
3.5 USING FORMS AND DATA VALIDATION
The best data entry practice is the combined use of DATA/FORM (taught
in the previous chapter) and DATA/VALIDATION. The combination
lends Excel quasi-database ability. Filtering and Pivoting (taught later in
the book) extend this ability.
Reducing Errors in Data Entry Validation & Autocorrect
57
3.6 AUTOCORRECT
The AUTOCORRECT tool automatically corrects common spelling errors
and mistakes in capitalization. The user can also define spellings that
should be corrected, as well as spellings or other typos that should not be
autocorrected. The tool is taught in Volume 4: Managing & Tabulating
Data in Excel


Using Fill & other Tools to Save Time
59
CHAPTER 4

USING FILL AND OTHER TOOLS
TO SAVE ON TYPING TIME
This chapter teaches the following topics:
MAKING EXCEL FILL IN NUMBERS AND DATES
FILLING YEARS/INTEGERS
FILLING IN EVERY ALTERNATE YEAR
AUTO FILL FILLING FROM PRE-DEFINED LISTS OF DAYS,
MONTHS, OTHER
CREATING A NEW CUSTOM LIST
FILLING MISSING VALUES
USING CONSTANT INCREASE IN VALUES
USING CONSTANT GROWTH RATES
FILLING FORMATS
USING THE RIGHT MOUSE FOR QUICK-FILLING
PLACING DATA ENTRY ICONS ONTO THE TOOLBAR
Please use an empty Excel worksheet to practice this and the next section.
Create a new Excel file to try the examples shown in this chapter.
Managing & Tabulating Data in Excel
60
4.1 MAKING EXCEL FILL IN NUMBERS AND DATES
Assume you want to type in the series of numbers (1991, 1992.1999) or
(1991, 1993 2003) on to consecutive cells in a row or column. One way
of doing this would be to type in each number manually. A faster
approach is to use EDIT/FILL. Section 4.1.a uses this approach.
In 4.2, I show how to fill months and weekdays.
In 4.3, I show how to define a Custom Lists of names. For each such
defined list, you can use EDIT/FILL to save time and preclude the
possibility of typos.
4.1.A FILLING YEARS/INTEGERS
Open a new Excel file. Assume you want to use EDIT/FILL to type in the
series of numbers (1991, 1992.1999) on to consecutive cells in a row or
column. Type the first number in the series (for an illustration of this, see
Figure 42).
Figure 42: Entering the start point for the Fill

Click on the cell you just typed into (cell B1 in this example), and drag the
mouse over the cells where you want to fill the series.
You can drag to the right or to the bottom. In the illustration in the next
figure, I drag it to the right across a row. For a pictorial reproduction, see
Using Fill & other Tools to Save Time
61
Figure 43.
Figure 43: Use the mouse to drag over the cells you want to fill

Access the feature through the menu path EDIT/FILL/SERIES.
Figure 44: The menu option and suboptions for Fill. Choose the sub-menu Series.

Figure 45 reproduces the dialog that opens. Excel has automatically
detected that the Series (is) in Rows. (That is, that you want to fill the
numbers on consecutive cells on a row.) Choose the option Linear in the
area Type.
Figure 45: Choosing the basis for the Fill

Note that Excel auto selects the Step value of 1. A step value of 1
Managing & Tabulating Data in Excel
62
implies that each consecutive cell will have a value that is 1 + the
preceding cells value.
Select the option Trend. The next figure illustrates this.
Figure 46: Filling with a Linear Trend that increments by one for each cell

Execute the dialog by clicking on the button OK. Excel fills the series.
For a pictorial reproduction, see Figure 47.
Figure 47: The series is filled with a Linear Trend of one

4.1.B FILLING IN EVERY ALTERNATE YEAR
Assume you want to fill the series (1991, 1993, 1995...) that is, every
alternate year/integer.
The procedure is the same as in the previous example with one
difference choosing a Step Value of 2 as shown in Figure 48.
(Compare this with the step value of one in the previous example.)
Using Fill & other Tools to Save Time
63
Figure 48: Filling with a Linear Trend that increments by two for each cell

Execute the dialog by clicking on the button OK. As you can observe in
Figure 49, the fill now uses steps of 2.
Figure 49: The series is filled with a Linear Trend of two

Use EDIT/FILL even if the desired series included text along with a
number sequence (for example, a series like yr91, yr92,, yr99).
4.2 AUTO FILL FILLING FROM PRE- DEFINED LISTS
OF DAYS, MONTHS, OTHER
Assume you want to fill the series of months.
Go to the first cell you want in the series and type in the name of the
month with which you want to start the series. (As shown in the next
figure, I chose Jan but that need not be the case.)
Managing & Tabulating Data in Excel
64
Figure 50: Type the initial month for generating a sequential series. You can also type
Janu, .., January

Click on the cell with the text Jan and lightly drag the mouse over the
cells into which you want the series filled. As the next figure shows, I
have dragged the mouse down over a column this time and not to the right
across a row as in the examples above. You can Fill series in all four
directions.
Figure 51: Select the range to Fill

Using the mouse, select the menu path EDIT/FILL/SERIES.
The dialog (user-input form) that opens is shown in the next figure.
Note that Excel has automatically determined that the series are in a
column because you dragged the mouse down.
Using Fill & other Tools to Save Time
65
Choose the option AutoFill
3
.
Figure 52: Using Autofill to Fill in the series of months

Execute the dialog by clicking on the button OK. Excel fills the list the
next figure shows the filled range.
Figure 53: The Filled series of months


3
Choose the option Date if the cell's data is defined as Data Type. A detailed
discussion of this is beyond the scope of this book.
Managing & Tabulating Data in Excel
66
4.2.A FILLING WEEKDAYS
Type in Monday or any other day and drag down or to the right. Follow
the menu path EDIT/FILL/SERIES.
Figure 54: Type the initial weekday for generating a sequential series

Choose the option AutoFill. Execute the dialog by clicking on the button
OK.
Figure 55: Using AutoFill to Fill in the series of weekdays

Excel fills the weekday series the next figure shows the result.
Using Fill & other Tools to Save Time
67
Figure 56: The Filled series of weekdays

4.3 CREATING A NEW CUSTOM LIST
You can create new lists that Excel will fill in automatically. Assume
you have three lists you work with often:
Employee names (Seligman, Gupta, Smith, Snipes, Stallone, Ali,
Kinnuken, Singh, Gunter, Mandela, Berger)
Client names (Nike, Adidas, Reebok, Old Navy, Bata)
Account names (Citibank, Chase, UBS, American Express, 1
st

Capital)
(Note: the client and account names are registered trademarks of the
respective companies.)
You want the ability to type in only one word from a list (for example, the
word Nike) and fill in the series with other words in the list Client
Managing & Tabulating Data in Excel
68
name by using EDIT/FILL/SERIES.
First, type the names of all members of each list onto a spreadsheet. (Use
a different row for each list as shown in Figure 57.)
Figure 57: Type the names of all members of each list onto a spreadsheet

Now you have to inform Excel that these lists are to be included as lists
for EDIT/FILL/SERIES/AUTOFILL. Select the menu path
TOOLS/OPTIONS/CUSTOM LISTS (for an illustration of this, see Figure
58).
Using Fill & other Tools to Save Time
69
Figure 58: The tab Custom Lists in the dialog (user-input form) TOOLS/OPTIONS.
Notice the lists for months and weekdays in the left half of the dialog. In the examples in the
previous section, Excel used these lists to fill in the series.

In Figure 58, notice the lists for months and weekdays in the left half of
the dialog. In the examples in 4.2, Excel used these lists to fill in the
series.
In Figure 58, focus on the area inside the darkbordered rectangle. You
want to Import lists from cells. Click on the area marked by the arrow
in Figure 58. Choose the cells in the worksheet that has the lists as
shown in Figure 59.
Managing & Tabulating Data in Excel
70
Figure 60: Choose the worksheet that has the lists

Choose the cells that have the list entries for one list (for example, the
clients list.) See the next figure for an illustration.
Figure 61: Choose the cells that have the entries for one list

Click on the small box marked by the arrow in Figure 61.
Using Fill & other Tools to Save Time
71
Figure 62: Importing the new Custom List

Execute the dialog by clicking on the button Import. A new list is
created as shown in Figure 63.
Figure 63: The new list is added to the Custom Lists

Managing & Tabulating Data in Excel
72
Repeat the above steps for the other two lists. Execute the dialog by
clicking on the button OK.
In the future, you just have to type in one entry from the client list (for
example, Nike) and use EDIT/FILL/SERIES to fill in the rest of the list.
Figure 64: After repeating the process for other lists, you will have created several Custom
Lists

4.4 FILLING MISSING VALUES
FILL is also used for replacing/fillingin missing values from a numerical
series. The methods available for filling in the missing data are:
Linear Interpolation (Linear in Absolute Value)
Constant Growth Interpolation (Linear in Growth Rate)
Using Fill & other Tools to Save Time
73
4.4.A USING CONSTANT INCREASE IN VALUES
Assume your data has two series: x and y as shown in the picture below
Figure 65
4
. The series x is missing data for the years 1993 and 1994. You
want to use Excel to fill the missing values using a simple mathematical
algorithm for the fill.
Figure 65: Type this sample data into an Excel worksheet

Highlight the cells with the missing data and the first nonmissing data
cell on each end. (For an illustration, see Figure 66.)
Figure 66: Highlight the two ends of the range with missing data

Follow the menu path EDIT/FILL/SERIES. Choose the options Linear.
Excel automatically calculates the step value of 0.16
5
. (For an
illustration, see Figure 67.)

4
On an empty Excel sheet, type in the data as shown in Figure 136 and work along
with this book.
5
The formula is: ((end value)-(start value)) / (number of missing values) = (3.6-3.12) / 3
= .16
Managing & Tabulating Data in Excel
74
Figure 67: Choose the Linear type of Fill

The missing cells are filled (for an illustration of this, see Figure 68). The
step value of 0.16 implies that Excel added 0.16 for each increment.
(So, the data for 1993 equals the data for 1992 plus 0.16. The data for
1994 is the new value for 1993 plus 0.16. And so on for the following
years.)
Figure 68: The missing data is filled with a linear trend

4.4.B USING CONSTANT GROWTH RATES
A better method of filling in missing values is to use a constant growth
rate. That is, instead of the above example in which every increment was
the same absolute number, the increment will represent the same growth
Using Fill & other Tools to Save Time
75
rate
6
from year to year but not the same absolute values.
The implementation of the constant growth method follows the same
steps as for the constant linear trend example described earlier. The only
difference is that you choose the option Growth and check the option
Trend as shown in Figure 69 (the number 0.16 is from the previous
example and will not play a role here.)
Figure 69: Example of using a Growth type of Fill

Excel fills the series. Figure 70 shows the result. Compare the numbers
estimated using a constant growth trend with those obtained using a
constant linear trend (shown in Figure 68).
Figure 70: The missing values are filled with numbers based upon a constant Growth rate


6
Excel calculates and uses a constant growth rate r based on the compound growth
(or compound interest") formula: 3.6 = 3.12*(1 + r)
3

Managing & Tabulating Data in Excel
76
4.5 FI LLI NG FORMATS
Assume you want to copy the format of a cell to a range of adjacent cells in
the same row or column. Select the active cell and the target range and
choose the menu option EDIT/FILL/FORMATS.
4.6 COPYING THE ACTIVE CELL
Assume you want to copy a cell and paste onto to a range of adjacent cells
in the same row or column. Select the active cell and the target range.
Select the option EDIT/FILL/COPY.
4.7 USING A RIGHT- CLICK- ON- MOUSE FOR QUICK-
FILLING
You can access EDIT/FILL using the mouse.
Click on the first cell in the series. Follow this with clicking on the right
mouse at the location shown by the arrow and dragging the mouse over
the other cells where you want to fillin. Leave the mouse. You will see
the options for EDIT/FILL. (For an illustration, see Figure 71.) Choose
the option Series the EDIT/FILL dialog opens. Follow the steps
shown in the examples above.
Using Fill & other Tools to Save Time
77
Figure 71: Tip for quickly accessing the Fill menu

4.8 PLACING DATA ENTRY ICONS ONTO THE
TOOLBAR
You can customize the set of icons shown on the toolbars at the top of the
screen. This can save time by enabling you to place the oftenused
buttons onto the toolbar. Please refer to Volume 3: Excel Beyond The
Basics to learn how and why to customize toolbars and the icons shown in
them.
Go to VIEW/TOOLBARS/CUSTOMIZE. Click on the category Data and
you will see some icons for specific data management tasks. You can
place these icons on the toolbar and use them as shortcuts to access data
management features.
Managing & Tabulating Data in Excel
78
Figure 72: Icons for data management

4.9 SPEECH TO TEXT
The menu option TOOLS/SPEECH in the XP version of Excel does not
function well. You need a high quality microphone, correct accent and
diction, and the time to make the Speech Recognition software recognize
your pronunciation.
Stand-alone speech recognition applications can be configured to work
with earlier versions of Excel. Unless you are purchasing high-end
Speech Recognition software, you will be disappointed with the tool. Such
high-end software is used in the health industry. Nevertheless, even
there, the recorded speech is transcribed into text by a human.


Managing & Tabulating Data in Excel
80
CHAPTER 5

CONDITIONAL FORMATTING
COLORCODING DATA
PATTERNS
This chapter illustrates the use of the following features:
UNDERSTANDING THE DIALOG
DEFINING THE CONDITION
STEP 1: DEFINING THE CONDITION/CRITERIA
STEP 2: DEFINING THE FORMAT TO USE FOR CELLS THAT
SATISFY THE CONDITION
UNDERSTANDING THE CONDITIONAL FORMAT
DEFINING A DYNAMIC CONDITION
DELETING CONDITIONAL FORMATS
CONDITIONAL FORMATTING is an excellent utility for quickly color
coding patterns in data. As you go through this example, the usefulness
of this utility will become clear.
5.1 UNDERSTANDING THE DIALOG
Access the feature through the menu path FORMAT/CONDITIONAL
Condition
Conditional Formatting Colorcoding data patterns
81
FORMATTING. The dialog shown in Figure 73 opens.
Figure 73: The Conditional Formatting dialog

In this box, you have to tell Excel: If condition 1 is satisfied by the data in
a cell than format the cell using Format 1 which you have defined. If
condition 1 is not satisfied by the data in a cell than do not format the cell
using Format 1.
5.2 DEFINING THE CONDITION
Figure 74 to Figure 77 show how to set the first conditional format. Let
us go through this process systematically.
5.3 STEP 1: DEFINING THE CONDITION/CRITERIA
Assume the conditional format is:
Managing & Tabulating Data in Excel
82
If the value of the cell is between 10,000,000 and 12,000,000 then
give the cell the formatting I will define by pressing the button
Format.'
First, define the condition as shown in Figure 74.
Figure 74: Defining the first condition

5.4 STEP 2: DEFINING THE FORMAT TO USE FOR
CELLS THAT SATISFY THE CONDITION
Click on the button Format
7
and (as shown in Figure 75 and Figure 76)
choose the formatting desired for those cells that satisfy the condition
Cell value is between 10,000,000 and 12,000,000.
Select the tab Patterns and choose the fill color for the cells.

7
On clicking Format, I got the dialogs shown in Figure 208 and Figure 209. I chose a
font style (see Figure 208) and a pattern/background shading (see Figure 209).
Conditional Formatting Colorcoding data patterns
83
Figure 75: Choose a pattern

I recommend using bright yet light and distinct colors. Dark colors will
make the reading of cell data a bit of a pain in the eye.
After selecting the pattern, you may want to select a font style also. I
recommend using patterns only. If you set font features in a conditional
format, select different font colors for every conditional format.
Figure 76: Choose a font style, color, etc.

Managing & Tabulating Data in Excel
84
5.5 UNDERSTANDING THE CONDITIONAL FORMAT
After clicking on the button OK, you will be back to the CONDITIONAL
FORMATTING dialog. (For a pictorial reproduction of this, see Figure
77).
Figure 77: The first condition and the concomitant formatting are defined

The formatting style you chose is displayed in the area
Preview of format to use when condition is true. The 'condition'
mentioned is what you had defined Cell Value is between 10,000,000
and 12,000,000.
Step 3: Adding more conditional formats
Assume you want to add more conditional formats (the maximum allowed
is three). In the dialog shown in Figure 77, see the button Add. Click on
this button. The result is that the dialog becomes bigger with a new sub
section titled Condition 2 as shown in Figure 78 below.
Conditional Formatting Colorcoding data patterns
85
Figure 78: Adding conditions to the Conditional Format

As you did for condition 1, define the expression for condition 2 and
condition 3 and the formatting style to be applied if the condition is
satisfied. I do not show all the steps because they are the same as for
condition 1.
5.6 DEFINING A DYNAMIC CONDITION
In this example, the condition does not reference a fixed number (as in
Figure 79 where the fixed number is 100,000,000) but, instead, a cell on
the Excel worksheet.
This can be termed as a dynamic condition, because it changes if the
referenced cells value changes (this cell is E14 in my example). If the
value in cell E14 changes, then any conditional format definition that
references the value in cell E14 will also change.
Managing & Tabulating Data in Excel
86
Figure 79: Another example of defining a condition

Figure 80: Example of defining a dynamic condition. If the definition cell (E14) changes,
then you may see a change in formatting of the cells using this definition.

After defining the conditional formats, execute the dialog by clicking on
the button OK. The formatting of cells that meet the criteria you defined
will change to the formats defined by you.
You may find that a lower level of magnification (zoom) allows
the patterns in the data to be seen more easily. Change the zoom level by
selecting the menu option VIEW/ZOOM and making the change. The
next figure illustrates this.
Excel offers preset options of magnifications/reductions from 200% to
25%. You can set a custom level by typing the value into the box
Custom (and selecting the option Custom). I usually set the zoom to
85%.
Conditional Formatting Colorcoding data patterns
87
Figure 81: ZOOM dialog

5.7 DELETING CONDITIONAL FORMATS
Select the area that is under conditional formatting. Go to
FORMAT/CONDITIONAL FORMATTING and click on the button
Delete. The dialog shown in the next figure opens. You can delete
conditional formats by pressing on the button Delete and choosing the
appropriate options from the dialog that opens.
Figure 82: Dialog for deleting Conditions in a Conditional Format

5.8 SELECTING ALL CELLS WITH THE SAME
CONDITIONAL FORMAT RULE
This topic is taught in Volume 3: Excel Beyond The Basics.


Sorting
89
CHAPTER 6

SORTING
This chapter discusses the following topics:
BASIC SORTING
CASE SENSITIVITY
SORTING BY ROWS
SORTING RANGES THAT DO NOT COVER ENTIRE COLUMNS
OR ROWS
6.1 BASIC SORTING
I use a simple data set for this example Advanced File2.xls. The set
has five columns; each column corresponds to one series/series. (For an
illustration, see Figure 83.)
Follow these basic rules for facilitating effective data handling:
Always write the series name in the first row.
Do not leave the first column empty
Managing & Tabulating Data in Excel
90
Figure 83: The sample data

Choose the columns you want to Sort by clicking the mouse on a column
title (like A) and then dragging the mouse over the other columns you
want to Sort.
Select the option DATA/SORT. In the dialog (user-input form), choose the
series by which you want to Sort.
Choose a series by (a) clicking on the downarrow next to the topmost
white box, and, (b) picking a series from the list of series.
Sorting by two or three series
Repeat this process with a second (and, after that, a third) choice of series
name in the middle (and, after that, lowest) box in the dialog. Excel first
sorts by the series whose name is in the topmost box. Within each value
of this series, it sorts the data by the values of the series whose name is in
the middle box.
I show an example with two series in the next figure.
Sorting
91

Figure 84: The dialog for Sorting

6.2 NAMES OF SERIES OR COLUMNS
How does Excel know the names of the series? It has picked them up
from the first row. I allowed this by clicking on Header row in the area
My list has. If you look at the worksheet, notice that the first row has
the label for each series. These are the headers. If there is no such
header row, then choose No Header row in the area My list has.
Figure 85: Choose if your data series have a label/heading in the first cell of each data series

Execute the dialog by clicking on the button OK.
Managing & Tabulating Data in Excel
92
The result is shown in Figure 86. The data is sorted first by Country
Name, then by Series Name.
Figure 86: Compare the Sorted data with the original data shown in Figure 83

6.3 CASE SENSITIVITY
Click on the button Options. The dialog (user-input form) that opens is
shown in Figure 87. Within this box, you can finetune the Sorting
options.
If you want the Sorting to be Case Sensitive (so that AA6 is higher
ranked than aa6), then select the option Case Sensitive.
Sorting
93
Figure 87: Opting for Case Sensitive Sorting

6.4 SORTING BY ROWS
In rare cases, you may have to Sort by rows. Choose the rows you want
to use for defining the sorting criterion. Drag the mouse over the entire
data that needs to be sorted (including the labels for each row, usually in
column A).
Choose the menu option DATA/SORT. The SORT dialog opens.
Figure 88: Sorting by rows click on the Options button and (see next figure)

Managing & Tabulating Data in Excel
94
Click on the options button and choose the option Sort left to right in
the area Orientation (for an illustration of this, see Figure 89).
Figure 89: Select Sort left to right for Sorting by rows

Execute the dialog by clicking on the button OK. You will be returned to
the Sort dialog, but it will look different from the dialog you were in
earlier.
The dialog it will ask you for the Rows to Sort by. Figure 90 shows the
Sort dialog when sorting by rows. Compare it to the generic Sort
dialog shown in Figure 88 above.
Figure 90: The dialog for Sorting when you are sorting by rows

Sorting
95
6.5 SORTING RANGES THAT DO NOT COVER ENTIRE
COLUMNS OR ROWS
Assume your main data is in the cells A1:D180. However, in cells below
row 180 and/or to the right of column D you have some formulae and
text that you do not want to include in the Sorting. This can be done
easily the process is similar to the examples above.
The only exception is that you do not click on the column or row titles
while selecting the range to Sort; instead, you highlight the cells that
define the range you want to Sort.
6.6 CHOOSING THE ENTIRE WORKSHEET
Choose the entire worksheet be clicking on the gray button on top of row
title 1 and to the left of column title A. The area is pointed out by the
arrow in Figure 91. Try it on a sample worksheet.
Figure 91: Selecting the sample data

Use this when you want apply a method to all the cells/rows/columns in a
worksheet, but be careful of not to make Excel and the computer waste
system resources by applying procedures to a large number of empty cells.


Filter ("Hiding the Data you do not want to View")
97
CHAPTER 7

FILTER (HIDING THE DATA YOU
DO NOT WANT TO VIEW)
This chapter teaches the following topics:
BY ONE CRITERION ON ONE COLUMN
THE FILTERING ARROWS
CHOOSING THE VALUE TO USE AS THE FILTERING
CRITERION
THE RESULT: A FILTERED WORKSHEET
COPYING AND PASTING THE FILTERED ROWS
REMOVING THE FILTER
CUSTOM FILTERING USING MULTIPLE CRITERION,
LOGICAL CONDITIONS, ETC
EXAMPLE OF A FILTER THAT HAS TWO CRITERIA OVER ONE
SERIES/COLUMN
USING THE WILDCARD *
FILTERING USING CRITERIA FROM MORE THAN ONE
COLUMN/SERIES
ICONS FOR SORTING AND FILTERING
Filtering is used to hide the data one is not interested in viewing at
present. For example, you may want to view only those rows that have
data for the country Algeria. Alternatively, only the data for Algeria and
Managing & Tabulating Data in Excel
98
(within the rows having Algeria data) only for those Algerian's in the
sample who are less than 20 years in age. (Please look at and work along
side on the sample data set Advanced File2.xls; otherwise, you may
not completely grasp this section.) Filtering provides this ability.
The chapter shows several examples of Filtering. Using this feature,
you can define criteria to Filter out (or hide) the data you do not want to
view on screen. Filtering has several uses; the section shows some of
these.
7.1 BY ONE CRITERION ON ONE COLUMN
Open the sample data file supplied
8
in the zipped file and work along with
the section.
Access the feature through the menu path DATA/FILTER/AUTOFILTER
as shown in Figure 92.
Figure 92: The menu option for Filtering


8
The sample is in one of the Excel files provided in the zipped file: Advanced
File2.xls.
Filter ("Hiding the Data you do not want to View")
99
7.1.A THE FILTERING ARROWS
Now the Filter is on. On the worksheet, you will observe small
downward arrows on each of the first rows. (I have made huge ovals
around them in Figure 93.)
Figure 93: The indicators that a column is Filterready

7.1.B CHOOSING THE VALUE TO USE AS THE FILTERING
CRITERION
Click on one of the arrows. A list will drop down. (For an illustration, see the next figure.)
Figure 94: Looking at the dropdown list of possible Filtering criteria

This list contains each unique value of the series Series Name (or,
equivalently, each unique value of the column a, except the value in the
first cell) and some other options:
(All) does no Filtering.
Managing & Tabulating Data in Excel
100
(Top 10) chooses the rows that have the 10 most occurring
values in that column.
(Custom) is very powerful and is discussed later in this section
Assume you want only to view the data for those in the category Age 15
19 years. Click on that label in the list displayed by Excel.
7.1.C THE RESULT: A FILTERED WORKSHEET
The worksheet will only show data for the rows in which the Series
Name series has the value you chose (Age 15 19 years). All else is
hidden (and not deleted). If you look at the row numbering on the left,
you will see nonconsequent numbers (3, 16, 29, etc.) as highlighted by
the rectangle in Figure 95. The unfiltered (or Filtered out) rows are
hidden
9
.

9
Unhide the rows by selecting the option DATA / FILTER / AUTOFILTER.
Filter ("Hiding the Data you do not want to View")
101
Figure 95: The results of a simple Filter one-value criteria for one data series

7.1.D COPYING AND PASTING THE FILTERED ROWS
One use of Filtering is to make a new worksheet with only the Filtered
data.
Therefore, after you have done the Filter above, highlight all the rows,
click on EDIT/COPY, go to an empty worksheet, click on the first cell and
choose the menu option EDIT/PASTE. You now have a new worksheet
with data for only the category
10
you chose in the Filter. (For an
illustration of this, see Figure 96.)

10
You chose Series Name = Age 15-19 Years.
Managing & Tabulating Data in Excel
102
Figure 96: Copying and pasting the Filtered data
(which will be a subset of the entire data set)

7.2 REMOVING THE FILTER
Select the option DATA/FILTER and choose AUTOFILTER. The Filtering
arrows will be removed and the Filtered out rows (which were hidden
when they had been filtered out) will be unhidden and visible again.
7.3 CUSTOM FILTERING USING MULTIPLE
CRITERION, LOGICAL CONDITIONS, ETC
Typically, one would use a more complex Filter. These are created using
the option Custom. Thus, this time click on the option (Custom).
Filter ("Hiding the Data you do not want to View")
103
Figure 97: Choosing the powerful Custom Filter criteria

7.3.A EXAMPLE OF A FILTER THAT HAS TWO CRITERIA OVER ONE
SERIES/COLUMN
Try an example choosing rows that meet either of two criteria:
Series Name = Age 15 19 years
Series Name = Age 20 24 years
Figure 98: Using the Custom AutoFilter dialog

7.3.B USING THE WILDCARD ASTERISK (*)
Try a more complex example
Managing & Tabulating Data in Excel
104
Filter all rows in which the cell in the column Series Name
contains the text 15 (and other stuff) but does not contain the text
64.
Figure 99: Using a wildcard and two conditions to define a custom AutoFilter

The options for this Filter are shown in Figure 99. The * is called a
wildcard. It means any other character/digit/text. So *15* will choose
any cell that contains 15. The choice 2? will choose any cell that
contains 2 followed by some characters (for example, 20, 24, and 29).
Removing the Filter
Choose the menu option DATA/FILTER and choose AUTOFILTER. The
Filtering arrows will be removed and the Filtered out rows (which were
hidden when they had been filtered out) will be unhidden and visible
again.
7.4 FILTERING USING CRITERIA FROM MORE THAN
ONE COLUMN/SERIES
You can also filter using criteria from more than one series.
Filter ("Hiding the Data you do not want to View")
105
Step 1:
First, click on the arrow next to Series Name, choose (Custom), and
choose criteria as shown in Figure 99. Execute the dialog by clicking on
the button OK. The worksheet will be Filtered based on these criteria
based on the column/series Series Name.
Step 2:
Now, Filter the Filtered data by running a Filter through a second
column/series Country Name. Click on the arrow next to Country
Name and choose custom criteria as shown in Figure 100 and the figure
next after that.
Figure 100: Setting up an additional Filtering criteria

Managing & Tabulating Data in Excel
106
Figure 101: Defining the custom AutoFilter for the second column used in this complex Filter
based on 2column/series

The worksheet will only show the data that corresponds to both the
multicolumn Filters.
11
(For an illustration of this, see Figure 102.)
Figure 102: The results of Filtering across categories of two columns

You can have as many levels of Filtering as the number of columns with
series. Each additional column you filter with adds more criterions to the
set defined by the previous columns being used to define the Filter.

11
The two Filters are shown in Figure 611 and Figure 613.
Filter ("Hiding the Data you do not want to View")
107
7.5 NEW IN THE XP VERSION OF EXCEL
You may insert or delete columns while the sheet is in filter mode.
7.6 ICONS FOR SORTING AND FILTERING
The icons shown in the right half of the next figure will be useful for
Sorting and Filtering data. You can customize the set of icons shown on
the toolbars at the top of the screen. This can save time by enabling you
to place the oftenused buttons onto the toolbar.
Please refer to Volume 3: Excel Beyond The Basics to learn how and why
to customize toolbars and the icons shown in them.
Figure 103: The Data menu icons


Selecting all Cells/content across the Worksheet that Satisfy aCriterion
109
CHAPTER 8

SELECTING ALL CELLS/CONTENT
ACROSS THE WORKSHEET THAT
SATISFY A CRITERION
This chapter teaches how to:
USE GO TO SPECIAL
SELECT CELLS ON THE BASIS OF SPECIAL CRITERIA AND
EXCEL FUNCTIONALITIES
8.1 THE GO TO OPTION
Excels Go To- Special feature allows you to make smart range selections
without programming. Using the mouse, select the menu path EDIT/GO
TO.
Managing & Tabulating Data in Excel
110
Figure 104: The GO TO dialog

Click on the button Special. The relevant dialog is shown in the next
figure. The options inside this dialog (user-input form) allow smart range
selection. The dialog is shown below.
Figure 105: GO TO/SPECIAL dialog

Selecting all Cells/content across the Worksheet that Satisfy aCriterion
111
8.1.A SELECTING CELLS WITH COMMENTS, EMPTY CELLS,
UNHIDDEN CELLS, CELLS IN THE CONTIGUOUS REGION OF
THE CURRENTLY ACTIVE CELL
Comments selects all the comments (and their underlying
cells) in the worksheet. You can choose to format all cells with
comments with a comment cell formatting (font, patterns, etc),
delete all comments, hide/autofit/size the rows or columns that
contain the cells that have comments, or use other features only
on the cells that contain comments. Excel displays a message if
it cannot find any cell with a comment. This is a shortcut for
determining if a worksheet has any comments.
Blanks selects all the blanks in the data worksheet, including
formatted but empty cells.
Current region selects the region around the current cell. A
region ends if Excel encounters blank rows or columns.
Last cell selects the last cell that has content or formatting. A
shortcut: press the key CNTRL, and, while the key is pressed,
press the key END.

Assume you started with a large amount of data in a
workbook. While working on the spreadsheet you cleared the
contents of many cells/rows/columns, but Excel is not showing
any reduction in file size. The reason may be that the cleared
cells are still stored in memory because they have some
formatting that was not cleared. You can use the Last Cell
utility to determine whether Excel is still storing the cleared
cells. (The solution is to select the cleared range(s) and using
EDIT / DELETE to remove all content and formatting from the
Managing & Tabulating Data in Excel
112
range(s).)
Visible cells only selects all cells except those that are in
hidden rows or columns. This feature is extremely useful is the
purpose of hiding was too exclude rows/columns from certain
procedures.
8.2 CONDITIONAL FORMATTING
This topic requires familiarity with Conditional Formatting, which is
taught in chapter 5 on page 80.
Conditional formats and All selects all cells that have a conditional
formatting defined on them. Once these cells are selected, you can:
1. Highlight them and place a marker like bold font on all the cells,
2. Remove the Conditional: formats by going to
FORMAT/CONDITIONAL FORMATTING and pressing on the
button Remove.

Figure 106: Selecting all cells that have any Conditional Formats

Conditional formats and Same selects all cells that satisfy the same
conditional formatting as the current cell. After making such a selection,
you can conduct procedures specifically on these criteria-satisfying cells.
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
113
In fact, this selection utility enhances and extends (beyond the initial
purpose) the usefulness of Conditional Formatting and Data
Validation.
Figure 107: Selecting all cells that satisfy the same conditional formatting as the active cell

8.3 SELECTING BASED ON DATA VALIDATION
This topic requires knowledge about Data Validation, a topic taught in
Volume 4: Managing & Tabulating Data in Excel.
Step 1:
Pick the menu option EDIT/GO TO, click on the button Special. Select
the option Data Validation in the dialog that opens.
The option All selects all cells that have validation rules defined for
validating data entry.
Figure 108: Selecting all cells that have any Data Validation Conditions

The option Same selects all cells that have the same validation rules (for
validating data entry) as the current cell.
Managing & Tabulating Data in Excel
114
Step 2:
Sect the scope of the selection All or Same.
Figure 109: Selecting all cells that satisfy the same Data Validation rules as the active cell

8.4 SELECTING BASED ON FORMULAE
This topic requires knowledge about Functions and Error Values. These
are taught in Error! Reference source not found. on page Error!
Bookmark not defined..
8.4.A CONSTANTS
Step 1:
Pick the menu option EDIT/GO TO, click on the button Special. Select
the option Constants in the dialog that opens. (See next figure.)
Constants selects all named constants of the data type defined by the
selected check boxes amongst the check boxes:
Numbers
Text
Logicals
Errors
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
115
Step 2:
Select one of these four options
Figure 110: Constants

8.4.B FORMULA RESULTS
Step 1:
Pick the menu option EDIT/GO TO, click on the button Special. Select
the option Formulas in the dialog that opens. (See next figure.)

Formulas selects all cells that have a formula and the formula result
conforms to the data type chosen in this dialog. The data types conform to
the four possible results of a formula:
Number
Text
Logical (True or False)
(Formula-) Errors the values (#N/A, #VALUE!, #REF!, #DIV/0!,
#NUM!, #NAME?, and #NULL!

Step 2:
Select one of these four options.
Managing & Tabulating Data in Excel
116
Figure 111: Formulas

Note:
Date and Time functions evaluate to a serial number that corresponds to
a specific point on the time continuum. Thus, they are Numbers.
8.5 SELECTING BASED ON CELL REFERENCES IN
FORMULAS
This topic requires knowledge about Function Referencing (refer to
Error! Reference source not found. on page Error! Bookmark not
defined.) and Formula Auditing (refer to chapter 14 on page 215).
8.5.A SELECTING ALL CELLS WHOSE FORMULAS REFERENCE THE
ACTIVE CELL (DIRECTLY OR/AND INDIRECTLY)
You can select all the cells whose formula references the active cell.
These formula cells are called Dependents.
Step 1:
Pick the menu option EDIT/GO TO, click on the button Special. Select
the option Dependents in the dialog that opens. (See next figure.)
Step 2:
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
117
Select Direct only or All levels from the two buttons below the
Dependents button.
The option Direct only restricts the selection to cells directly
referencing the current cell.
The option All levels selects all cells that reference however
indirectly - the active cell.
Figure 112: Selecting all cells whose formula is dependent upon the value of the active cell

Figure 113: Selecting all cells whose formula has a direct reference to the active cell

8.5.B SELECTING ALL CELLS REFERENCED (DIRECTLY OR/AND
INDIRECTLY) BY THE FORMULA IN THE ACTIVE CELL
You can select all the cells that are used as references in the active cells
formula. These referenced cells are called Precedents.
Step 1:
Pick the menu option EDIT/GO TO, click on the button Special. Select
the option Precedents in the dialog that opens.
Managing & Tabulating Data in Excel
118

Figure 114: Select Precedents

Step 2:
Select Direct only or All levels from the two buttons below the
Dependents button.
The option Direct only restricts the selection to only directly
referenced cells that is, the cells referenced by the formula in
the current cell.
The option All levels selects cells referenced directly or indirectly
in the formula of the current cell. Indirect references are the
cells referenced by the cells directly referenced by the formula
in the current cell.
8.6 GO TO / SPECIAL AS A SEARCH TOOL
GO TO/SPECIAL can play a role as a search tool. For example, in the
circumstance that no criterion-satisfying cell could be located, Excel
displays a message with information to this effect. For example, choosing
the options shown in the next figure will tell you if any of the formulas
return errors. (In addition, the selection facilitates easy deletion of error-
containing cells.)


Subtotals
119
CHAPTER 9

SUBTOTALS
This chapter teaches the following topics:
BEFORE MAKING SUBTOTALS
OBTAINING SUBTOTALS
CHOOSING THE SUBTOTALING FORMULA: AVERAGE, SUM,
ETC
VIEWING ONLY THOSE ROWS THAT HAVE SUBTOTALS
REMOVING SUBTOTALS
9.1 BASICS
Subtotal adds new rows that capture subtotals for groups defined by
consecutive rows. If you want to make a table with only the subtotals (or
any other aggregate function) then use the powerful Pivot Report feature.
(I discuss Pivot Reports in the next chapter.)
The data set for this chapter is Advanced File2.xls.
Managing & Tabulating Data in Excel
120
9.2 BEFORE MAKING SUBTOTALS
The data set for this section is Advanced File2.xls. I am going to
produce the subtotals of the variables '1995', '2000' and '2010' by
categories of the series 'Country Name.
You should first select the option DATA/SORT and choose to Sort the data
by the series you choose in at each change in. (See chapter 6 and Figure
115.)
Figure 115: You have to Sort the data before creating subtotals

9.3 OBTAINING SUBTOTALS
Access the feature through the menu path DATA/SUBTOTAL. The dialog
(user-input form) for Subtotals is shown in Figure 116.
Subtotals
121
Figure 116: The subtotals dialog

In the area at each change in define the criterion for the subtotals.
(The examples are shown in Figure 115 and Figure 117). Choose at each
change in 'Country Name. That is, when a new category
12
is found, then
the subtotal of the previous category is inserted.
Choose the columns whose data you want subtotaled click to the left of
the column/series name in the area Add subtotal to. (For an illustration,
see Figure 117.)

12
In this example, each category is the name of a country
Managing & Tabulating Data in Excel
122
Figure 117: Choosing the variables whose subtotals are desired

9.3.A CHOOSING THE SUBTOTALING FORMULA: AVERAGE, SUM,
ETC
Click on the arrow next to Use function and choose the aggregate
function as shown in Figure 118
13
.
Figure 118: Choosing the method for subtotaling


13
Note: the same function does the aggregation for all the series you chose. In Pivot
Reports, you do not have this restriction. More on that on page 109.
Subtotals
123
Figure 119: The data worksheet with new rows containing the subtotals

Execute the dialog by clicking on the button OK. The subtotals will be
calculated and inserted into new rows on the data worksheet (as shown in
the rightmost figure).
9.4 VIEWING ONLY THOSE ROWS THAT HAVE
SUBTOTALS
Use the group collapsing minus indicators taught in Volume 1: Excel For
Beginners to view only those rows that contain totals.
9.5 REMOVING SUBTOTALS
Assume you want to remove the rows with the totals. Deleting each row
is a pain.
An easier way: choose the menu option DATA/SUBTOTALS. Click on the
button Remove All.
Managing & Tabulating Data in Excel
124
Figure 120: Removing subtotals

9.6 THE CONSOLIDATION TOOL
This tool (accessed through DATA/CONSOLIDATION) is unreliable and
quirky, especially in terms of accepting and retaining cell references. I do
not recommend using this tool. Far better consolidation of data can be
done using Pivot Reports (refer to the next chapter on the next page), the
Statistics Add-In (refer to Volume 5: Statistics Analysis With Excel), or
just manual formula construction (refer to Volume 3: Excel Beyond The
Basics or Volume 5: Statistics Analysis With Excel).


Managing & Tabulating Data in Excel
126
CHAPTER 10

PIVOT REPORTS
This chapter teaches the following topics:
THE FOUR STEPS IN MAKING A TWO-DIMENSIONAL PIVOT
REPORT
STEP 1: OPENING THE PIVOT REPORT WIZARD
STEP 2: CHOOSING THE DATA FOR TABULATION
STEP 3A: DESIGNING THE PIVOT REPORT
STEP 3B: CHOOSING THE FORMULA FOR
AGGREGATION/TABULATION
STEP 4A: OPTIONS
STEP 4B: WRAPPING IT UP CREATING THE PIVOT REPORT
MODIFYING/EDITING A PIVOT REPORT
MODIFYING THE STRUCTURE OF A PIVOT REPORT
ADDING A NEW FUNCTION (AND THUS A NEW ROW SERIES)
EDITING FIELDS
SELECTING A FIELD
VIEWING THE OPTIONS AVAILABLE FOR
MODIFYING/EDITING A FIELD
DELETING A FIELD
REFRESHING THE REPORT
Pivot Reports
127
PIVOT REPORT EXAMPLE WITH A THIRD DIMENSION (ROW,
COLUMN, AND PAGE)
VIEWING DIFFERENT PAGES
MAKING A NEW WORKSHEET FOR EACH PAGE
MAKING A NEW CHART FOR EACH PAGE
ICONS FOR PIVOT
Pivot Report is the most powerful feature for making tables by
aggregating over data. Pivot Reports give Excel the tabulating power of
SPSS, SAS, and other statistical software.
With Pivot Reports, you can create new worksheets of data in which the
data is at an aggregate level. After that is done, the aggregated data on
this new worksheet can be used to make graphs, calculate formulas, etc.
10.1 THE FOUR STEPS IN MAKING A TWO-
DIMENSIONAL PIVOT REPORT
I will take you through an example to illustrate how to make a Pivot
Report. Please experiment on the sample data set
14
included in the
zipped file you downloaded.

14
The sample data set is on sheet base in the file Sample Pivot1.xls.
Managing & Tabulating Data in Excel
128
10.1.A STEP 1: OPENING THE PIVOT REPORT WIZARD
15

Access the feature through the menu path DATA/PIVOT REPORTS
(Excel 97) or DATA/PIVOT REPORTS and PIVOT CHART REPORT
(Excel XP).
Figure 121: Accessing the menu for a Pivot Report

The first dialog of the Pivot Report wizard opens and (shown in Figure
122) asks you for the location/data you want analyzed (tabulated).
Usually you will use an Excel List
16,17
.
This step of the wizard has been completed.

15
A wizard is a series of dialogs used for processes that need multiple dialogs. A
wizard typically has the buttons Next, Back, and Finish. These buttons allow
you to move to the next dialog, the previous dialog and to finish the process,
respectively. You should be able to separate out the four steps in the Pivot Report
wizard by the end of this chapter.
16
Multiple consolidation ranges allows you to choose data that is in different
worksheets or in non-adjacent ranges on the same sheet (or both).
17
After you read 0 on page 158 the usefulness and procedure for using External data
source will become apparent. At the end of 0 you will be presented a challenging
task to combine the data management features learnt in that and the current
chapter on Pivots.
Pivot Reports
129
Move on to the next step/dialog by clicking on the button Next.
Figure 122: The first dialog of the Pivot wizard in Excel 97

Figure 123: The first dialog of the Pivot wizard in the XP version of Excel

Managing & Tabulating Data in Excel
130
Figure 124: Excel XP and later versions provide the option of creating charts in additions to
tables

10.1.B STEP 2: CHOOSING THE DATA FOR TABULATION
A small dialog opens (for an illustration of this, see Figure 125). With the
mouse, highlight the data
18
you want summarized in the Pivot Report
19
.
This step of the wizard has been completed.
Move to the next step/dialog by clicking on the button Next.
Figure 125: The dialog for step two of the Pivot wizard


18
Usually you do not need to do this as Excel automatically picks up the range of data
on the sheet that is active.
19
The Browse button allows one to use data from Excel files other than the active file.
Pivot Reports
131
10.1.C STEP 3A: DESIGNING THE PIVOT REPORT
The third dialog of the Pivot Report wizard opens in Excel 97. In Excel
XP, an interim step is needed. The dialog shown in Figure 126 opens.
Click on the button layout. The dialog for Pivot layout (same as in Excel
97) opens. (For an illustration of this, see Figure 127.)
Figure 126: First dialog in step three of the Pivot wizard in the XP version of Excel

Click on the button Layout. The layout dialog is the same as in Excel
97.
Managing & Tabulating Data in Excel
132
Figure 127: Step three of the Pivot wizard in Excel 97 and the second stage in step three of the
wizard in Excel 2000 & later versions

Now you are ready to construct the table. A table has three components:
The rows
The columns
The data cells (which has summarized data like the means of
series)
Drag and move Country Name to the area ROW, Series Name to the
area COLUMN as you can see in Figure 128. (Note: you can use more
than one row or column series; the column variables usually should have
only a few categories for ease of printing.)
You should see similar options if you are using the sample data set which
is on worksheet base in the file Sample Pivot1.xls.
Pivot Reports
133
Figure 128: Creating the layout for the Pivot Report
selecting the series to aggregate over the rows and columns of the Pivot Report

10.1.D STEP 3B: CHOOSING THE FORMULA FOR
AGGREGATION/TABULATION
Drag the first data cell qualifier into the area DATA as shown in Figure
129. Note that Excel has automatically called it Count of
Figure 129: Choosing the data series whose aggregated values will form the content of the
Pivot Report

Managing & Tabulating Data in Excel
134
Changing the function
Assume you want a different function Sum of and instead of Count
of.
Double-click on the button Count of 1995. The dialog shown in Figure
130 opens. Choose the appropriate formula.
Figure 130: Selecting the formula for aggregation

Note:
By clicking on Number you can choose the number format of the cells of
the data in the output worksheet. The button Options allows further
customization. (The specifics are beyond the scope of this book.)
Execute the dialog by clicking on the button OK. Do the same for any
other series you want displayed in the data cells. (For example, choose
the Sum of the series 2000 as shown in Figure 131.)
Pivot Reports
135
Figure 131: Completing the Pivot layout

The use of the area PAGE will be shown in 10.3 on page 152. This step
of the wizard has been completed. Move on to the next step/dialog by
clicking on the button Next.
10.1.E STEP 4A: OPTIONS
Click on the button Options.
Managing & Tabulating Data in Excel
136
Figure 132: Step four of the Pivot wizard in Excel 97

Figure 133: Stage one of step four of the Pivot wizard
in the XP version of Excel

Pivot Reports
137
Figure 134: Stage two of step four of the Pivot wizard in the XP version of Excel

Name: you can give the Pivot Report a custom name. The name should
not have any blank spaces.
Format options:
Grand totals for columns and rows will calculate the field for each
column or row category.
Auto Format table will give the Pivot Report a formatting that
looks good in a printout.
Subtotal hidden page items: beyond the scope of this book.
Merge labels: experiment and judge if merging labels makes the
table easier to read.
Managing & Tabulating Data in Excel
138
Preserve formatting: preserves the formatting of the data type
For error values, show: you can choose to have errors displayed as
blanks, or with a special notation like #Error.
For empty cells, show: you can choose to have empty cells
displayed as blanks, or with a custom sign such as or
Empty or #Null.
Try the other format options and observe how they affect the Print
Preview of the Pivot Report.
Data options
Save data with (Pivot) table layout: deselect the option if all
you want to save is the Pivot Report design. You will then
have to refresh the table manually each time you reopen
the file and want to complete the Pivot Report.
Enable drilldown: select this option.
Refresh on open: this option recalculates the fields in the
Pivot Report. Select if you want to ensure that the table is
always updated and current (with respect to the source data)
Refresh every X minutes: you can choose this option instead
of Refresh on open.
External data options
If you are using an external data source, then you may want
to Save the password so that the updating of the Pivot
Report with new data does not require a password each
time.
Pivot Reports
139
The option background query is beyond the scope of this
book.
The option Optimize memory should be selected if the
processing of the external data (in making the Pivot Report)
utilizes too much of active memory or resources of the
computer.
10.1.F STEP 4B: WRAPPING IT UP CREATING THE PIVOT REPORT
You may prefer to use a new worksheet. All the steps of the wizard have
been completed. Execute the wizard by clicking on the button Finish.
Figure 135: Completing the Pivot wizard in Excel 97

Managing & Tabulating Data in Excel
140
Figure 136: Completing the Pivot wizard in the XP version of Excel

The Pivot Report is made. It is shown in Figure 137.
Figure 137: The Pivot Report

You have already run a Pivot on this data do you notice the Pivot
worksheets for the old Pivot?
10.2 MODIFYING/EDITING A PIVOT REPORT
The story is not over! Pivot Reports are very powerful because
(1) You can make graphs and calculate statistics at a more aggregate level
Pivot Reports
141
then you could with the original worksheet.
(2) You can change Pivot Reports even after they are made! Changing
them is made easy by the Pivot Report toolbar. You will view this
toolbar floating over the worksheet with a Pivot Report.
20
The toolbar is
shown in the next figure.
Figure 138: The Pivot toolbar with icons for modifying the Pivot Report

Experiment and witness what happens when you click different options
on this toolbar. In particular, find the options that allow you to:
Edit the Pivot Report design (shown in Figure 129) 2
nd
from
left in top row of icons
Change the Function choices (shown in Figure 130) 3
rd
from
left in top row of icons
If you choose to place a series in the area PAGE as will be
shown in 10.3 on page 152, this allows you to make separate
worksheets for each category of the PAGE series 4
th
from left
in top row of icons

20
If you do not see this toolbar, choose the menu option VIEW / TOOLBARS and choose
PIVOT REPORT.
Managing & Tabulating Data in Excel
142
Pivot Reports can be modified further. Click anywhere on the Pivot
Report and then click on the right mouse.
The menu shown in Figure 139 will be visible.
Figure 139: The shortcut menu for a Pivot Report

10.2.A MODIFYING THE STRUCTURE OF A PIVOT REPORT
The option Wizard takes you back to the Step 3 of the Pivot Report
Wizard (for an illustration of this, see Figure 140). If you desire, you can
make changes to the Pivot Report design.
In the example illustrated in the next figure, you have added a data series
Sum of Change...
Pivot Reports
143
Figure 140: Adding additional series for the data area

The other options in the shortcut menu are beyond the scope of this book.
(Nevertheless, if you feel confident, play around with the options Select
and Options.)
10.2.B ADDING A NEW FUNCTION (AND THUS A NEW ROW SERIES)
Let us insert a new function/field to the Pivot Report. The function is
percentage change from 1995 to 2000
21
.
Choose the option Insert from the shortcut menu shown in Figure 139.
The dialog shown in Figure 141 opens.

21
The desired formula is ='2000' / '1995' -1.
Managing & Tabulating Data in Excel
144
Figure 141: Adding a new function for a data field

First, as shown in the next figure, write the name of the new function.
Figure 142: Naming the new data field

At this point, go to the area Formula: and delete the zero.
Figure 143: Typing the formula for the new data field 1

Go to the area Fields: and choose the series name 2000. Then click on
the button Insert Field. A reference to the series 2000 is automatically
inserted into the formula.
Pivot Reports
145
Figure 144: Typing the formula for the new data field 2

Figure 145: Typing the formula for the new data field 3

Type the operator for division.
Figure 146: Typing the formula for the new data field 4

Managing & Tabulating Data in Excel
146
You may repeat the steps I did for
inserting a reference to 2000 this
time inserting a reference to the series
1995. (For an illustration of this, see
the next three figures.)
Figure 147: Typing the formula for the new data
field 6

Type 1. The formula is complete.
Figure 148: Typing the formula for the new data
field 7

Figure 149: Typing the formula for the
new data field 5

The completed dialog is shown in Figure 150.
Pivot Reports
147
Figure 150: Typing the formula for the new data field 8

Execute the dialog by clicking on the button OK. The new field is added
to the Pivot Report as shown in Figure 151.
Figure 151: The Pivot Report with the new field

The rows labeled Sum of Change 95 2000 were not in the original
Pivot Report. Compare this figure with Figure 137.
Managing & Tabulating Data in Excel
148
10.2.C EDITING FIELDS
Assume you want to make changes to all the cells that relate to the field
Sum of Change 95 2000.
Selecting a field
First, you have to select all the data that relates to the field Sum of
Change 95 2000. The usual clickanddrag (or CONTROL and click)
method of selecting cells will not work. In a Pivot Report, one selects a set
of data by selecting a cell that contains the label for that field.
Click on cell B5 (or B8 any cell with the label Sum of Change 95
2000). You will witness that all the cells that contain text/data on the
particular field are automatically chosen and highlighted.
By clicking on cell B5, you select all the cells that relate to the field of
Sum of Change 95 2000. Unlike a normal Excel worksheet, this is the
way to select items/cells in a Pivot Report. This is shown in Figure 152.
After selecting, you can delete/format/edit the labels and data for the field.
Pivot Reports
149
Figure 152: Selecting all the data and labels for one data field

Viewing the options available for modifying/editing a field
After selecting the field, click on the right mouse to view the shortcut
menu shown in Figure 153.
Managing & Tabulating Data in Excel
150
Figure 153: The shortcut menu for modifying/formatting the cells for one data field

Choose the option Format Cells
22
. The dialog shown in Figure 154
opens. Choose the number format of percentage.
Make any other choices you desire.
Execute the dialog by clicking on the button OK.

22
The option Insert was discussed in the previous sub-section. The option Format
cells is discussed in this sub-section. The next sub-section briefly explains the
purpose of the other options in the menu.
Pivot Reports
151
Figure 154: Formatting the cells underlying the data for only one data field

The cell formats are changed, but only for the cells related to the field
Change 95 2000.
Similar changes for other fields
Repeat the steps corresponding to Figure 152 to Figure 155.
Figure 155: The number format of the data has been changed

Managing & Tabulating Data in Excel
152
Note:
If you select a series label (like Age 0 19 and over 64 years (in cell C2
refer to the previous figure) then the data selected will include the data
in column C. After selecting the label (and thereby the data and label)
click on the right mouse and try out some of the options in the popup
menu that appears.
10.2.D DELETING A FIELD
The Delete option removes (from the Pivot Report) the selected field.
10.3 REFRESHING THE REPORT
The option Refresh Data recreates the Pivot Report. This option is
useful if there is any change in the data on which the table is based.
10.4 PIVOT REPORT EXAMPLE WITH A THIRD
DIMENSION (ROW, COLUMN AND PAGE)
Using the same data set, this time, select the option DATA/PIVOT
REPORT and choose the design shown in Figure 156. Alternatively, click
on the old Pivot twodimensional Pivot Report, and then click on the right
mouse.
From the options in the popup menu, select the option Wizard. Change
the design by dragging and dropping the buttons for each series. In the
Pivot Reports
153
example below, you can see that Country name has been moved from the
area Column to the area Page.
This section's results are shown in the files Sample Pivot2.xls and
Sample Pivot3.xls.
Start with Sample Pivot1.xls. (That is, continue from the previous sub
section). Change the Pivot Wizard such that it has a third dimension
Page. You can use the layout I show in the next figure.
Figure 156: Adding a third dimension (the PAGE option) to a Pivot Report

Drag and move the series Country Name to the indicator for Page.
(For an illustration of this, see Figure 156.) Follow the other steps as in
the previous example.
The Pivot Report is shown in Figure 157. I show this result in the file
Sample Pivot2.xls. Note that, at the top of the Pivot Report (in cell B1),
Managing & Tabulating Data in Excel
154
you see a downward arrow (and the text (All).
Figure 157: Using the Filter dropdown box for viewing each page in a threedimensional
Pivot Report 1

10.4.A VIEWING DIFFERENT PAGES
Click on the downward arrow in cell B1 You will get a view of the list of
possible values for the series you placed in the area Page in the Pivot
Report design shown in Figure 156. Part of this list is shown in Figure
158. If you click on one value/item in the list, the Pivot Report will change
to show a table based on the data only for that item. (If you choose the
item Algeria, the Pivot Report will change to the one shown in Figure
159.
Figure 158: Using the Filter dropdown box for viewing each page in a threedimensional
Pivot Report 2

Pivot Reports
155
Therefore, when you do a 3D Pivot Report, you are creating several
Pivot Reports, one for each of the categories in the series placed in the
Page area.
Figure 159: Using the Filter dropdown box for viewing each page in a threedimensional
Pivot Report 3

10.4.B MAKING A NEW WORKSHEET FOR EACH PAGE
Click anywhere within the Pivot Report. Click on the right mouse. The
menu shown in Figure 160 will be displayed.
Choose the option Show Pages. Excel will make a separate worksheet
for each item in the list in cell B1. You will have 19 worksheets! This is
an extremely powerful tool.
The result is shown in the sample file Sample Pivot3.xls.
Managing & Tabulating Data in Excel
156
Figure 160: Making a new worksheet for each category of the variables in the third dimension

10.4.C MAKING A NEW CHART FOR EACH PAGE
In Excel XP, you can also request Charts from the results of the Pivoting
procedure. Excel will produce multiple charts for a threedimension Pivot
layout (that is, a row, column, and page dimension).
Design a Pivot layout that produces the multiple
charts shown in the sample file Sample Pivot3.xls.
10.5 PIVOT REPORTS FROM SCENARIOS
This topic is taught in Volume 3: Excel Beyond The Basics.
Pivot Reports
157
10.6 OLAP: NEW FEATURE IN THE XP VERSION OF
EXCEL
XP has the new features of item properties and Online Analytical
Processing (OLAP). These topics are beyond the scope of this book.
10.7 ICONS FOR PIVOTING
The icons shown in the right half of the next figure will be useful for
creating, modifying, and managing a Pivot Report. You can customize the
set of icons shown on the toolbars at the top of the screen. This can save
time by enabling you to place the oftenused buttons onto the toolbar.
Figure 161: Icons for Pivot Reports

Please refer to Volume 3: Excel Beyond The Basics to learn how and why
to customize toolbars and the icons shown in them.


If-then Analysis: Scenarios & Goal Seek
159
CHAPTER 11

IF-THEN ANALYSIS: SCENARIOS
AND GOAL SEEK
This chapter discusses the following topics:
SETTING THE DESIRED VALUE FOR THE TARGET CELL
(THE ONE WITH THE FORMULA THAT REFERENCES THE
SOLUTION CELL)
CHOOSING THE SOLUTION CELL
RUNNING THE UTILITY
11.1 SCENARIOS (FOR IF THIS ASSUMPTION- THEN
THIS RESULT)
The sample data for this section is in the file Scenarios.xls.
The data in columns C, D and E is the size of the labor force in years
1995, 2000 and 2010, respectively, for specific age groups defined in
column A and for countries defined in column B. The cell H3 holds
the assumption of the cumulative or total growth rate of the labor force
from the year 2010 to 2020.
This rate is assumed equal for all age groups and countries. Column F
is calculated by multiplying the corresponding cell in column E with
Managing & Tabulating Data in Excel
160
100% plus the growth rate of 40% in cell H3. Therefore, column F
values are 40% higher than the values in column E. The formulas in the
cells in column G directly reference cell H3.
The cells H6, H7, and H8 provide statistical parameters for the year
2020 for the country Algeria (that is, for the cells F2 to F14).
These formulas indirectly reference cell H3 through the formulas in the
cells F2 to F14.
Figure 162: The sample data and formula cells

11.1.A DEFINING THE SCENARIOS
Go to the menu option TOOLS/SCENARIOS. The relevant dialog is
shown in the next figure.
If-then Analysis: Scenarios & Goal Seek
161
Figure 163: The dialog for TOOLS/SCENARIOS before any scenarios are defined. Click on
the button Add to define a scenario.

Click on Add and define the first scenario. The scenario is the next
figure illustrates. The first scenario is named 40. It assumes that the
value of cell H3 is 40% or 0.40.
You can make assumptions of several cells, including non-adjacent cells
and cells across sheets.
Figure 164: The first scenario

A comment has been added to explain the scenario. All the other options
are the defaults I recommend sticking with them.
Managing & Tabulating Data in Excel
162
After the first scenario is defined, click on the button Add and define the
second scenario. This scenario is named 50 and works on changing the
cell H3.
Figure 165: The second scenario is named 50 and works on changing the cell H3

The second scenario assumes that the value of cell H3 is 50% or 0.50.
Figure 166: The second scenario assumes that the value of cell H3 is 50% or 0.50

The two scenarios are defined. The dialog shows the two scenarios. The
dialog is reproduced in the next figure.
If-then Analysis: Scenarios & Goal Seek
163
Figure 167: The two scenarios are defined

You can define more scenarios.
Using the Scenarios
Viewing the result of a scenario
Click on the scenario name 40, followed by the button Show. The cell
H3 will take on the value assumed in the scenario (40% or 0.40). All the
cells whose formula references the assumption cell H3 will change.
In this example, these cells are those in the column G (direct reference
to the assumption cell) and the values of the formulas for the mean,
median and maximum of column G (indirect reference to the
assumption cell H3).

Managing & Tabulating Data in Excel
164
Figure 168: Result of the first scenario

Switching over to the view of the result of another scenario
Click on the scenario name 50, followed by the button Show. The cell
H3 will take on the value assumed in the scenario (50% or 0.50). All the
cells whose formula references the assumption cell H3 will change.
In this example, these cells are those in the column G (direct reference
to the assumption cell) and the values of the formulas for the mean,
median and maximum of column G (indirect reference to the
assumption cell H3).
Figure 169: Result of second scenario

Scenario summary
At this stage, the use of scenarios is not very useful because you can only
If-then Analysis: Scenarios & Goal Seek
165
see the results of one scenario at one time. You may wonder if a better
option is to copy the worksheet and use 40% in cell H3 of 1 worksheet
and 50% in cell H3 of the other worksheet.

Figure 170: Obtaining a Scenario Summary

The real power of Scenarios comes from its ability to create a comparative
summary table from the different scenarios. Click on the button
Summary. Choose the option Scenario summary and the cells whose
values you want to compare across the scenarios. I have chosen the cells
that contain the mean, median and maximum of column G.
The Scenario Summary is created and displayed on a new worksheet.
Note that the columns compare across scenarios, while the rows display
the formula results you wish to compare.
Making the output easily interpretable
You can type in Assumed Growth Rate, Mean, Median and
Maximum into cells C6, C8, C9, and C10, respectively.
Managing & Tabulating Data in Excel
166
Figure 171: The Scenario Summary is created and displayed on a new worksheet

Using the Group and Outline tool
Note that Excel has automatically inserted the plus and minus signs,
grouping range outlines, and grouping levels (1 and 2) to the Scenario
Summary table. Experiment with using these indicators to learn more
about Grouping and Outlining, a skill taught in Volume 1: Excel For
Beginners.
If-then Analysis: Scenarios & Goal Seek
167
Figure 172: Collapsing the grouped Scenario columns D F by clicking on the grouping
indicator minus at the top. (The indicator can be seen in the previous figure. The indicator
changes to a plus.)

Figure 173: Expand the columns so that all the columns can be seen. Now contract the group
of row 4 and the group of row 6 by clicking on the minus signs for both of them. (The
indicators can be seen in the previous figure. The indicators change to a plus.)

Managing & Tabulating Data in Excel
168
Figure 174: Re-expand the rows by clicking on the two plus indicators for the rows

Scenario-based Pivot Tables
Go to the dialog (user-input form) for TOOLS/SCENARIOS after the
scenarios have been defined.
Click on the button Summary.
Choose the option Scenario Pivot and the cells whose values you want
use in the data region of the Pivot.
Figure 175: Obtaining a Scenario Pivot

If-then Analysis: Scenarios & Goal Seek
169
The Pivot is created on a new worksheet. This Pivot is simple and small
because we have defined only one assumption cell, two scenarios within
this assumption cell, and three result cells.
The number of data rows in the Pivot equals the number of
scenarios.
The number of data columns equals the number of result cells.
The number of pages in the Pivot is defined by the number of
users who have defined assumption cells.
Figure 176: The Pivot is created on a new worksheet

See Error! Reference source not found. to
learn how to collaborate and work simultaneously on one file. If you click
on the Merge button in the main Scenarios dialog, then you can merge
the scenarios defined by different users. Choose a different page if you
have more than one user by clicking on its name in the list that opens
when you press the arrow on the right of cell B1.
You can create a separate worksheet and a separate chart for each page
using methods taught in Volume 4: Managing & Tabulating Data in Excel
and Volume 2: Charting in Excel.
Managing & Tabulating Data in Excel
170
The users who have defined scenarios will be listed. All lists all the
scenarios defined by all users. Use the Merge button to merge scenarios
by different users.
Figure 177: The users who have defined scenarios will be listed

11.2 GOAL SEEK (IF I WANT THIS CELL TO HAVE A
CERTAIN RESULT, WHAT VALUE SHOULD THAT
CELL TAKE)
Type this formula into cell F4 of the sample data file Advanced
File2.xls.

This formula will add the values in cells B2, B3 B8 and then add this
sum to the value in cell D4 multiplied by 1.23. Note that the formula
references the cell D4 and the cells B2 to B8.
I will show how Excel permits you to find a value for D4 such that F4
equals a desired target value. Assume you want to find the value in cell
If-then Analysis: Scenarios & Goal Seek
171
D4 that will make the value of the formula in F4 equal to 10,000,000,000.
11.2.A SETTING THE DESIRED VALUE FOR THE TARGET CELL (THE
ONE WITH THE FORMULA THAT REFERENCES THE
SOLUTION CELL)
Click on the cell F4 that is, the cell for which a desired value is
sought. Then choose the menu option TOOLS/GOAL SEEK. The
relevant dialog is shown in Figure 178.
Enter the desired/target value into the box to value as shown in Figure
179.
Figure 178: The Goal Seek dialog

11.2.B CHOOSING THE SOLUTION CELL
You want F4 to achieve the given value by changing the value in cell D4.
Managing & Tabulating Data in Excel
172
So enter D4 in the box By changing cell as shown in Figure 179
23
.
Figure 179: Choosing the solution cell

Running the utility
Execute the dialog by clicking on the button OK. You will be told if a
solution was found. Go and look at cell D4. The value in there is the
desired one the value that makes F4 = target or desired value.

23
Alternatively, click on the box marked by the arrow and then choose the cell from
the sheet.


Managing & Tabulating Data in Excel
174
CHAPTER 12

LINKING TO A DATABASE
This chapter teaches the following topics:
IMPORTANT DEFINITION: QUERY
UNDERSTANDING THE STRUCTURE OF A DATABASE FILE
ANALOGY BETWEEN THE STRUCTURES OF A DATABASE
FILE AND AN EXCEL FILE
LINKING TO DATA FROM A DATABASE (OR, CREATING AND
EXECUTING A DATA QUERY)
STEP 1: CHOOSING THE DATABASE FILE FROM WHICH
DATA WILL BE IMPORTED
STEP 2: CHOOSING THE COLUMNS/FIELDS/VARIABLES TO
IMPORT
SELECTING FIELDS FOR IMPORT INTO EXCEL
STEP 3: (PRE) FILTERING THE DATA TO BE IMPORTED
STEP 4: PRESORTING THE DATA TO BE IMPORTED
STEP 5: SAVING THE QUERY (THAT IS, SAVING STEPS 1 4)
STEP 6: WRAPPING IT UP GETTING THE DATA INTO EXCEL
REFRESHING THE LINK BETWEEN THE EXCEL RANGE AND
DATA IN THE DATABASE FILE
EDITING AN EXISTING QUERY
USING EXTERNAL DATA SOURCE TO CREATE A PIVOT
REPORT
Linking to a Database
175
ICONS RELEVANT TO EXTERNAL DATA
Excel has a simple yet powerful tool for obtaining and linking to data from
databases. A range of cells on an Excel worksheet is linked to the source
data from the database. The source data is not just raw data; instead, it
is the raw data rearranged, filtered, and sorted as per the instructions of
the user.
In 12.2 you learn all the steps for linking an Excel range to data from a
database. The first four steps involve the definition of a data import
protocol, also called a query. The last step is the execution of the
query that is, the actual import of the data.
Important definition: Query
A Query defines a protocol for reading in data from a database.
Intuitively, one is Querying (that is, asking a question of) the database
for obtaining data that satisfies criteria that make up the definition of the
query. It is much easier than it sounds!
By refreshing this link, one makes sure that the linked cells in Excel
contain the latest data in the source database. Any chart that is made
from data in the linked cells will automatically be updated
24
12.3 on
page 193 illustrates the ease of refreshing the data link (also called
updating the query.)

24
Once you learn to read data from external sources, you will feel comfortable with
using database linkages in other contexts and programs. (For example, for doing a
Mail Merge to create mass-mailing letters in Word, or for reading data from
database formats into SPSS, Lotus, etc.)
Managing & Tabulating Data in Excel
176
You may want to change the data import specifications that you defined
in a query you created earlier. The easiest way to do this is to open the
old query and make modifications to it. On page 194, 12.4 introduces
editing a predefined query.
Source Database (on network drive, web, etc) Query that Filters,
Sorts and arranges data Linked cells on Excel worksheet Tables,
formulas, Pivot Reports and charts (in Excel, Word, etc) that reference the
data in the linked cells
12.1 UNDERSTANDING THE STRUCTURE OF A
DATABASE FILE
A database file typically has several tables. Each table has several
fields/columns. Intuitively, think of an Excel workbook (or file) as a
database. Perceive each worksheet in the workbook as analogous to a
table and each column in a worksheet as a field/column in a database. A
simple schematic chart of a database structure is shown in Figure 180.
Figure 180: The structure of a database file
Database1 Table2
Table1
Table3
Table1.Field2
Table1.Field1
Table1.Field3
Table1.Field4

Linking to a Database
177
Analogy between the structures of a database file and an Excel file
I use Table 10 on page 177 to illustrate the analogy between Excel and
database structures. The row numbered 1 contains the largest object.
The row numbered 2 contains a smaller object which in itself is a part of
the object in row 1. The row numbered 3 contains an even smaller
object which in itself is a part of the object in row 2
25
.
Table 10: Analogy between a database file and an Excel file
Database Excel
1 Database file like Bookstor.mdb Excel workbook or file
2
Tables like the table All Titles
shown in Figure 184.
An individual worksheet
3
A field like Au_ID shown in Figure
185
A column in the worksheet (like
column A, B, etc)
Click on a field name and click on the button Preview Now. You will see
a sample of the data in that field (as shown in Figure 186 below the label
preview of data in selected column).
12.2 LINKING TO DATA FROM A DATABASE (OR,
CREATING AND EXECUTING A DATA QUERY)
Open a new Excel file. Follow the six steps described in the rest of this

25
Therefore, in Excel, the object workbook contains worksheets which contain
columns. In addition, in a database file format, the object database contains
tables which contain fields.
Managing & Tabulating Data in Excel
178
section.
12.2.A STEP 1: CHOOSING THE DATABASE FILE FROM WHICH DATA
WILL BE IMPORTED
Access the feature through the menu path DATA/GET EXTERNAL
DATA/CREATE NEW QUERY as shown in Figure 181.
Figure 181: Accessing the menu option for creating a new query for linking with a database

Excel will first ask for the source of the data (that is, the format in which
the source data is stored) for an illustration of this, see Figure 182. In
the figure, five possible sources are shown
26
.
You may have more or less show up on your computer. The formats that
show up are a function of the drivers (a program that, in this context,
allows a program to read a file in the format associated with the specific
driver. You can buy/download drivers for different database formats.

26
Note that Excel and Text Files are not, strictly speaking, database formats.
Nevertheless, the same protocol can be used to read files form these sources also. In
a way, an Excel file is like a database. More on this later in the chapter see Table
96 on page 177
Linking to a Database
179
Figure 182: Step one of the Query wizard choosing the data source

Check the option Use the Query Wizard. The database file you will use
in this example is an Access database. So, choose the database format
Microsoft Access 97.
Click on the button Browse. In The relevant dialog (shown in Figure 183),
browse through the network of drives and choose the Access file that has
the source data
27
. (The file Bookstor.mdb is included in the zipped
file you downloaded.) Execute the dialog by clicking on the button OK.
The query wizard is launched it is shown in Figure 184.

27
Database files typically have certain security features. For example, you may have
permission to read data from the database but not to write data to it. If that is the
case, then check the box Read Only. In addition, the database may be on a network
path that is not shown in the list of drives in the drop-box Drives. You will have to
click on the button Network and choose the appropriate drive and path. Usually
you will need a password to access the drive and / or the database file. Consult the
techies in your office / school for more information.
Managing & Tabulating Data in Excel
180
Figure 183: Step one of the Query wizard choosing the path and name of the database file

12.2.B STEP 2: CHOOSING THE COLUMNS/FIELDS/VARIABLES TO
IMPORT
After you click on OK in the dialog shown in Figure 183, the Query
Wizard will be launched. The first dialog within this wizard is shown in
Figure 184.
The left half of this dialog shows the names of all the tables in the
database file. Notice the plus signs to the left of each table name.
If you click on the sign, then the fields in that table can be viewed (as
shown in Figure 185 for the table Authors).
Linking to a Database
181
Figure 184: Step two of the Query wizard (choosing the data series to import) 1

Note that each field (which corresponds to a column in Excel) must be
fetched from inside a table; the table itself needs to be accessed through
the database file.
Figure 185: Step two of the Query wizard (choosing the data series to import) 2

Managing & Tabulating Data in Excel
182
Click on a field name and then click on the button Preview Now. You
will see a sample of the data in the selected field.
The next figure illustrates this.
Figure 186: Step two of the Query wizard (choosing the data series to import) 3

Selecting fields for import into Excel
How does one select the field/column one wants to import into Excel? For
an entire table, click on the table's name on the left half and click the
right arrow button. (This button is marked by the arrow in Figure 187.)
For a specific field or column, first click on the plus sign (click on a
specific field/column name, and then click on the right arrow button. (The
right arrow button is marked by the arrow in Figure 187.)
Note that each field you choose will be imported as a column onto the
Linking to a Database
183
Excel worksheet. So, if you choose X number of columns/fields, you will
import X columns in Excel.
Figure 187: Step two of the Query wizard (choosing the data series to import) 4

After choosing all fields/columns from the table Authors, I clicked on the
table name Title Author and chose all the fields in that table except for
Au_ID (because the field is common to the two tables I have accessed the
fields from Authors and Title Author I only need to select it from
one of the tables. (For an illustration of this, see Figure 188.)
You may follow my example, or select any other fields/columns.
Managing & Tabulating Data in Excel
184
Figure 188: Step two of the Query wizard (choosing the data series to import) 5

The fields are selected. Move to step three by clicking on the button Next.
12.2.C STEP 3: (PRE) FILTERING THE DATA TO BE IMPORTED
Once you choose all the fields you need, this step of the wizard is
complete. Move on to the next step/dialog by clicking on the button Next.
The Filter dialog shown in Figure 189 opens. This dialog allows you
to Filter data; to Filter in data you desire to import and Filter out
cases you do not want to import. Filtering implies the selection of a
subset of the fields (that you selected in the dialog shown in the previous
figure) based on criteria defined by you.
You are Querying the database
Go get me only the fields I selected, in the tables I selected and only for
those cases/rows that match my criteria for selection.
Linking to a Database
185
Figure 189: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 1

Assume the first criterion is the selection of only those cases/rows in
which the Au_ID is field/column is not empty (null).
Figure 190: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 2

Managing & Tabulating Data in Excel
186
Click on the field name Au_ID.' on the right side of the dialog, click on
the downward arrow (for an illustration of this, see Figure 190), and
choose the option is Not Null (for an illustration of this, see Figure 191).
Figure 191: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 3

The first criterion has been defined.
Assume that the second criterion is only cases/row where the
field/column Year Born is between 1945 and 1954. On the left half of
the dialog, click on the field/column label Year Born (for an illustration
of this, see Figure 192).
Enter the criteria in the right half of the dialog. First, click on the
downward arrow.
Linking to a Database
187
Figure 192: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 4

You will notice a list of possible operators. Choose the operator greater
than or equal to (for an illustration of this, see Figure 193). On the right
of the operator list, you will view another downward arrow. Click on
that you will see all the values inside the field/column Year Born.
Choose the value 1945 (or type in the value).
Even though you are in Excel, you have picked up information from the
database file! Excel is already Querying the database and has picked up
information like the type of data in each field numeric or string/text, the
range of values, etc.
Therefore, although you are in Excel, and remain in Excel throughout the
process of querying, Excel has managed to enter into the database file and
obtain the table definitions, field definitions, etc.
Managing & Tabulating Data in Excel
188
Figure 193: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 5

Figure 194 shows the first half of the criterion is greater than or equal to
1945. I also want only those values where Year Born is less than or
equal to 1954. Because it is an additive criteria (that is, I want both
criteria to be obeyed), choose the option and as shown in Figure 194.
Click on the downward arrow in the second row for criteria and choose the
criterion in a similar fashion as done for the first criteria.
You may follow my example, or set your own filter.
Linking to a Database
189
Figure 194: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 6

Now only those rows/cases will be selected which fit the criteria Au_ID is
not empty (null) and the Year Born is between 1945 and 1954, end points
inclusive. (For an illustration of this, see Figure 195.)
Figure 195: Step three of the Query wizard (setting the criteria for selecting the observations
to be imported) 7

Managing & Tabulating Data in Excel
190
This step of the wizard has been completed. Move to the next step/dialog
by clicking on the button Next.
12.2.D STEP 4: PRESORTING THE DATA TO BE IMPORTED
The next dialog (shown in the next figure) in the wizard allows you to Sort
the data (as it is read into Excel) by the fields of your choice. I have
chosen to Sort [a] first by ascending values of the field Year Born and [b]
second by ascending values of the field Author. You may follow my
example, or set your own sorting rules.
Figure 196: Step four of the Query wizard (preSorting the data to be imported)

You have completed step four of the process. Move to step five by clicking
on the button Next.
Linking to a Database
191
12.2.E STEP 5: SAVING THE QUERY (THAT IS, SAVING STEPS 14)
The Query is defined! You may want to use the query again, edit
(change) it, extend it, or check its structure later. In order to make these
processes possible, click on the button Save Query (for an illustration of
this, see Figure 197) and save the query (for an illustration of this, see
Figure 198).
Figure 197: Step five of the Query wizard (saving the query) 1

Figure 198: Step five of the Query wizard (saving the query) 2

When you click on the button Save, you will be taken back to the query
wizards last dialog (shown in Figure 197).
Managing & Tabulating Data in Excel
192
12.2.F STEP 6: WRAPPING IT UP GETTING THE DATA INTO EXCEL
Click on the option Return Data to Excel and click on the button Finish.
(For an illustration of this, see Figure 199.)
Figure 199: Step six of the Query wizard (getting the data into Excel) 1

Choose where you want the data to be read int. I advise choosing the
option New Worksheet. (For an illustration of this, see Figure 200.)
Figure 200: Step six of the Query wizard (getting the data into Excel) 2

Linking to a Database
193
The data is read into Excel as shown in Figure 201.
Figure 201: The imported data

Save the Excel file in a folder that has access to the database file.
12.3 REFRESHING THE LINK BETWEEN THE EXCEL
RANGE AND DATA IN THE DATABASE FILE
The data is a live link. This Excel worksheet has automatically been
linked to the query you created. Whenever you want to replace the data
in the worksheet with the latest data in the database, open the Excel file,
and click on this worksheet. Select the option DATA/REFRESH DATA!
You have a live link to a database. This is extremely useful if you want to
add dynamism to your Excel file and/or if your source data is of a kind
that is regularly updated.
Managing & Tabulating Data in Excel
194
Figure 202: Menu on a worksheet that contains imported data

Note that all charts, tables, and formulas that reference the data in the
linked cells will also be automatically updated when you refresh the link.
When making a Pivot Report, you can link directly to the source database
by choosing the option external data source in the first dialog of the
Pivot Report wizard. This dialog is shown in Figure 122 on page 129.
12.4 EDITING AN EXISTING QUERY
Choose the worksheet that has the downloaded data and follow the menu
path DATA/GET EXTERNAL DATA/EDIT QUERY. You will be shown
the query wizard. Use steps similar to those shown on 12.2 to edit and
redefine the query.
Linking to a Database
195
12.5 USING EXTERNAL DATA SOURCE TO CREATE A
PIVOT REPORT
While making a Pivot Report, one option for the source data is External
data source. In the previous chapter on Pivot Reports, I skipped over
that option (for an illustration of this, see Figure 122 on page 129 and
footnote 17 on page 128). The use of External data sources required the
knowledge you got in this chapter.
Make a Pivot Report using the external data source
used in this chapter.
12.6 NEW IN THE XP VERSION OF EXCEL: OLAP
12.6.A DATA FROM THE INTERNET
The procedures have new features that allow data import using the latest
in internet technology. Online Analytical Processing (OLAP) is a new
mode for obtaining data.
12.7 ICONS RELEVANT TO EXTERNAL DATA
You can customize the set of icons shown on the toolbars at the top of the
screen. This can save time by enabling you to place the oftenused
buttons onto the toolbar. Please refer to Volume 3: Excel Beyond The
Basics to learn how and why to customize toolbars and the icons shown in
Managing & Tabulating Data in Excel
196
them.

The icons shown in the next figure provide easy access to refreshing
linked data or to changing the properties of the link with the external
data source.
Figure 203: Icons for the Query or Import wizard


Managing & Tabulating Data in Excel
198
CHAPTER 13

READING ASCII TEXT DATA
Contents of chapter:
UNDERSTANDING ASCII TEXT DATA
WHY IS DATA STORED AND DISTRIBUTED IN THIS FORMAT?
WHAT IS SPECIAL ABOUT THIS FORMAT?
FIXEDWIDTH/COLUMN
DELIMITED/FREE-FIELD
READING DELIMITED/FREE-FIELD ASCII TEXT DATA
STEP 1: CHOOSING WHETHER THE FORMAT IS DELIMITED
OR FIXED WIDTH
STEP 2: CHOOSING THE CORRECT DELIMITER: TAB, COMMA,
SPACE, ETC
DETERMINING IF EXCEL/YOU HAVE CHOSEN THE WRONG
DELIMITER
STEP 3: DEFINE THE DATA FORMATS (IF NOT DONE
AUTOMATICALLY/CORRECTLY BY EXCEL)
CONVERTING INTO AN EXCEL FILE
READING FIXED WIDTH/COLUMN ASCII TEXT
The most difficult stage of a project should not be the reading in of data.
Unfortunately, the ASCII Text format (often called simply ASCII or
Text format) can make this stage extremely frustrating and time
consuming.
Reading ASCII Text Data
199
Advice
Though I teach how to read ASCII Text data into Excel, bear in mind the
following issues:
If the suppliers of data can provide you with data in a simpler format
then request them to do so!
An excellent option for quickly converting data from different file
formats into Excel format is by the use of data conversion software like
STATTRANSFER (web site: www.stattransfer.com) or DBMSCOPY (web
site: www.dbmscopy.com).
13.1 UNDERSTANDING ASCII TEXT DATA
Why is data stored and distributed in this format?
Most large data sets, especially those available to the public via CDROM
or the web, are in ASCII Text format because of (1) the relatively small
disk space needed to store and distribute ASCII TEXT data and (2) the
conformity of ASCII with standardization guidelines across operating
systems and hardware.
What is special about this format?
As the name Text suggests, ASCII Text data is data written in the form
of text, as in a Note Pad, Word, or WordPerfect file. In contrast to ASCII,
data is organized into rows and columns in Excel.
Managing & Tabulating Data in Excel
200
When ASCII data is being entered, dataentry involves typing the data
for variables next to each other while separating different variables by a
standard character
28
(called a Delimiter) or by column positions. These
concepts will become clear as I now delve deeper into understanding the
two broad types of ASCII TEXT formats.
Fixedwidth/Column
29

In this format, the data is identified by position. When you obtain such
data, you will need a code book which tells you the position each series
occupies in the file.
Assume there are three variables: ID, First Name, and Last Name. The
case to be entered is ID=009812348, First Name = VIJAY, and Last
Name = GUPTA. The codebook states that the series ID is to be
entered in the position 1 to 9, first name in 10 to 14 and last name in 15
to 21. The dataentry person does this.
When you read the data into Excel, you have to provide the program with
information on the positions of variables. That is, reading our sample file
would involve, at the minimum, the provision of the following information:
ID=1 to 9, First Name =10 to 14 and Last Name =15 to 21. This is
shown in the next text-box.


28
The standard delimiters are: tab, comma, or space.
29
The reading of fixed-field / column ASCII text data is beyond the scope of this book.
Reading ASCII Text Data
201
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Actual data 0 0 9 8 1 2 34 8 V I J A Y G U P T A

Delimited/Free-Field
In this ASCII Text format, spaces, tabs, commas, or semicolons separate
data series. That is, after entering the data for one of the variables, the
dataentry person places a Delimiter to indicate the beginning of the next
series. The next text-box shows this for the three common Delimiters:
space, tab, and comma.
Space delimited (.prn): 00981234821 VIJAY GUPTA
Tab delimited: (.dat): 00981234821 VIJAY
GUPTA
Comma delimited (.csv): 00981234821,VIJAY,GUPTA
ASCII files may have many other extensions. Some of the extensions I
have seen are .asc, .txt, .hac, etc. In addition, a .csv file may not
always be a commadelimited file.
13.2 READING DELIMITED/FREE- FIELD ASCII TEXT
DATA
Using the mouse, select the menu path FILE/OPEN. Choose the ASCII
TEXT file use the file Text format.txt supplied in the zipped file
and click on Open. The File Open dialog opens this dialog is shown
in Figure 204.
Managing & Tabulating Data in Excel
202
Figure 204: The File Open dialog

Irrespective of the file extension, Excel automatically recognizes the file
as an ASCII Text file, and, consequently, launches the 1
st
dialog of the
Text Import Wizard (shown in Figure 205).
13.2.A STEP 1: CHOOSING WHETHER THE FORMAT IS DELIMITED OR
FIXED-WIDTH
The file could have either of the two broad categories of formats: delimited
(also called freefield), or fixedwidth (also called fixed-column).
The Excel Wizard 'senses' that the ASCII Text file is of the delimited type.
Reading ASCII Text Data
203
Therefore, it selects the option Delimited in the area Original data
type
30
.
Figure 205: Step one of the Text Import wizard

Interestingly, Excel can also read in ASCII Text data that was stored
using Macintosh, DOS, or OS/2 operating systems (for an illustration of
this, see Figure 206.)

30
Excel may make a mistake sometimes; if it has selected the incorrect option (between
'Delimited' or 'Fixed width'), then you should make the correction manually by
choosing the correct option. (The agency that supplied the data should have supplied
you information on the specifications of the ASCII text file.)
Managing & Tabulating Data in Excel
204
Figure 206: Choosing the File Origin

Choose the options as shown in Figure 207. This step of the wizard has
been completed. Move on to the next step/dialog by clicking on the button
Next.
13.2.B STEP 2: CHOOSING THE CORRECT DELIMITER: TAB, COMMA,
SPACE, ETC
Now you are at step 2 of the Text Import Wizard (for an illustration of
this, refer to Figure 207). In step 2, you will choose the precise type of
Delimiter. As shown in Figure 207, Excel has 'sensed' the correct
Delimiter is Tab. Look at the sample of the file in the area Data
preview. The long vertical lines indicate the column/series end/beginning
points.
Does the sample make sense? If the answer is in the negative, you should
experiment with other types of Delimiters.
Reading ASCII Text Data
205
Figure 207: Step two of the Text Import wizard 1

Determining if Excel or you have chosen the wrong Delimiter
Let us try the Space Delimiter. The Data preview area now shows how
the data will look if read in as spacedelimited. The sample looks
patently incorrect
31
. This is the good thing about the wizard you can
view samples to assist you in determining the best Delimiter. (Note:
Usually the correct Delimiter will be provided to you by the agency that
provided the data.)

31
Look at the haphazard position of the dark black vertical bands in the first row of the
data (in the Data preview box shown in Figure 692.
Managing & Tabulating Data in Excel
206
Figure 208: Step two of the Text Import wizard 2

Therefore, select the correct Delimiter Tab.
Figure 209: Step two of the Text Import wizard 3

You have finished the second dialog in the wizard. Click on the button
Next.
13.2.C STEP 3: DEFINE THE DATA FORMATS (IF NOT DONE
AUTOMATICALLY/CORRECTLY BY EXCEL)
In this step (step 3 of the wizard), you can define the data formats for each
series/column or to skip the import of a certain column. I find these two
Reading ASCII Text Data
207
issues dealt better in Excel outside of the Text Import Wizard
32
.
Therefore, just click on the button Finish.
Figure 210: Step three of the Text Import wizard

The data is read in and is shown in Figure 211.

32
Using the menu option FORMAT / CELLS and the key DELETE.
Managing & Tabulating Data in Excel
208
Figure 211: The data is imported into Excel

13.2.D CONVERTING INTO AN EXCEL FILE
Choose the menu option FILE/SAVE AS and save the file as an Excel
workbook so that, in the future, you do not have to use the Import Text
Wizard to read the same ASCII Text file.
Has Excel read in all the cases? Please check. The
ASCII Text file may be much larger than the holding capacity of an Excel
worksheet (depending on your version of Excel and the size of the ASCII
TEXT file). Excel may not give a message like Failed to read in all the
data. I would suggest scrolling down to the end of the Excel worksheet.
If the last row and/or column are filled then it is highly probable that
some of the data was not read.
You should check if the data formats are correct for the purpose of your
use of the data. In the situation of errors id formats, choose the column(s)
reformat the data type using the menu option FORMAT/CELL/NUMBER.
Perform this procedure separately for each data type. (The F4 key
whose use is taught in Volume 1: Excel For Beginners makes such work
much easier. Do the formatting for one column. After that, choose other
Reading ASCII Text Data
209
columns to which you want to apply the same formatting and then press
the F4 key.)
13.3 READING FIXED- WIDTH ASCII TEXT
Select the option FILE/OPEN. Choose the ASCII Text file. Irrespective of
the file extension, Excel automatically recognizes the file as an ASCII
TEXT file, and, consequently, launches the 1
st
dialog of the Text Import
Wizard shown in the next figure.
The Excel Wizard 'senses' that the ASCII Text file is of the Fixed-width
type. Therefore, it selects the option Fixed-width in the area Original
data type
33
.

33
Excel may make a mistake sometimes; if it has selected the incorrect option (between
'Delimited' or 'Fixed width'), then you should make the correction manually by
choosing the correct option. (The agency that supplied the data should have supplied
you information on the specifications of the ASCII text file.)
Managing & Tabulating Data in Excel
210
Figure 212: Step one of the Text Import wizard for Fixed-width Text data

Click on the button Next. The second dialog of the wizard opens. Excel
senses the column widths and places demarcation lines. (The
demarcating lines are called Break Lines.)
Reading ASCII Text Data
211
Figure 213: Step two of the Text Import wizard for Fixed-width data 1

Excel often makes errors in picking the demarcation points. Use the
mouse to set the correct column widths.
Managing & Tabulating Data in Excel
212
Figure 214: Step two of the Text Import wizard for Fixed-width Text data 2

Click on the button Next. In this dialog (step 3 of the wizard), you can
define the data formats for each series/column or to skip the import of a
certain column.
I find these two issues dealt better in Excel outside of the Text Import
Wizard
34
. So, just click on the button Finish and the data are imported
into Excel.

34
Using the menu option FORMAT / CELLS and the key DELETE.
Reading ASCII Text Data
213
Figure 215: Step three of the Text Import wizard for Fixed-width Text data

Figure 216: The data is imported into Excel

Choose the menu option FILE/SAVE AS save the file as an Excel
workbook. This ensures that, in the future, you do not have to use the
Import Text Wizard to read the same ASCII Text file.


Paste Special
215
CHAPTER 14

PASTE SPECIAL
This chapter teaches the following topics:
PASTING THE RESULT OF A FORMULA, BUT NOT THE
FORMULA
OTHER SELECTIVE PASTING OPTIONS
PASTING ONLY THE FORMULA (BUT NOT THE FORMATTING
AND COMMENTS)
PASTING ONLY FORMATS
PASTING DATA VALIDATION SCHEMES
PASTING ALL BUT THE BORDERS
PASTING COMMENTS ONLY
PERFORMING AN ALGEBRAIC OPERATION WHEN PASTING
ONE COLUMN/ROW/RANGE ON TO ANOTHER
MULTIPLYING/DIVIDING/SUBTRACTING/ADDING ALL CELLS
IN A RANGE BY A NUMBER
MULTIPLYING/DIVIDING THE CELL VALUES IN CELLS IN
SEVERAL PASTED ON COLUMNS WITH THE VALUES OF
THE COPIED RANGE
SWITCHING ROWS TO COLUMNS
This less known feature of Excel has some great options that save time
and reduce annoyances in copying and pasting.
Managing & Tabulating Data in Excel
216
14.1 PASTING THE RESULT OF A FORMULA, BUT NOT
THE FORMULA
Sometimes one wants the ability to copy a formula (for example, =C223 +
D223)) but paste only the resulting value. (The example that follows will
make this clear.)
Select the range F223:F235 on worksheet main.
Choose the menu option FILE/NEW and open a new file. Go to any cell in
this new file and choose the menu option EDIT/PASTE SPECIAL.
In the area Paste, choose the option Values as shown in Figure 217.
Figure 217: The PASTE SPECIAL dialog in Excel versions prior to Excel XP

Paste Special
217
In Excel XP, the Paste
Special dialog has three
additional options:
Paste Formulas and
number formats (and
not other cell
formatting like font,
background color,
borders, etc)
Paste Values and
number formats (and
not other cell
formatting like font,
background color,
borders, etc)
Paste only Column
widths.
Figure 218: Paste Special dialog In Excel XP

In Excel XP, the Paste
icon provides quick access to
some types of Paste
Special. The options are
shown in the next figure.
The calculated values in the
copied cells are pasted.
The formula is not pasted.
Try the same experiment
using EDIT/PASTE instead
of EDIT/PASTE SPECIAL.
The usefulness of the former
will be apparent.
Figure 219: The pasting options can be accessed by
clicking on the arrow to the right of the Paste icon

Managing & Tabulating Data in Excel
218
14.2 OTHER SELECTIVE PASTING OPTIONS
14.2.A PASTING ONLY THE FORMULA (BUT NOT THE FORMATTING
AND COMMENTS)
Choose the option Formulas in the area Paste of the dialog (user-input
form) associated with the menu EDIT/PASTE SPECIAL. This feature
makes the pasted values free from all cell references. The pasted on
range will only contain pure numbers.
The biggest advantage of this option is that it enables the collating of
formula results in different ranges/sheets/workbooks onto one worksheet
without the bother of maintaining all the referenced cells in the same
workbook/sheet as the collated results.
Figure 220: Pasting formulas only

14.2.B PASTING ONLY FORMATS
Choose the option Formats in the area Paste of the dialog associated
with the menu EDIT/PASTE SPECIAL use the Format Painter icon. I
prefer using the icon.
Paste Special
219
Refer to Volume 1: Excel for Beginners for a discussion on the format
painter.
14.2.C PASTING DATA VALIDATION SCHEMES
Pick the option Validation in the area Paste of the dialog associated
with the menu EDIT/PASTE SPECIAL. Data validation schemes are
discussed in Volume 4: Managing & Tabulating Data in Excel. This
option can be very useful in standardizing data entry standards and rules
across an institution.
14.2.D PASTING ALL BUT THE BORDERS
Choose the option All except borders in the area Paste of the dialog
associated with the menu EDIT/PASTE SPECIAL. All other formatting
features, formulae, and data are pasted. This option is rarely used.
14.2.E PASTING COMMENTS ONLY
Pick the option Comments in the area Paste of the dialog associated
with the menu EDIT/PASTE SPECIAL. Only the comments are pasted.
The comments are pasted onto the equivalently located cell. For example,
a comment on the cell that is in the third row and second column that is
copied will be pasted onto the cell that is in the third row and second
column of the pasted on range. This option is rarely used.
Managing & Tabulating Data in Excel
220
14.3 PERFORMING AN ALGEBRAIC OPERATION
WHEN PASTING ONE COLUMN/ROW/RANGE ON
TO ANOTHER
14.3.A MULTIPLYING/DIVIDING/SUBTRACTING/ADDING ALL CELLS
IN A RANGE BY A NUMBER
Assume your data is expressed in millions. You need to change the units
to billions that is, divide all values in the range by 1000. The complex
way to do this would be to create a new range with each cell in the new
range containing the formula cell in old range/1000. A much simpler
way is to use PASTE SPECIAL.
On any cell in the worksheet, write the number 1000. Click on that cell
and copy the number. Choose the range whose cells need a rescaling of
units. Go to the menu option EDIT/PASTE SPECIAL and choose Divide
in the area Options. The range will be replaced with a number obtained
by dividing each cell by the copied cells value!
The same method can be used to multiply, subtract or add a number to all
cells in a range
Figure 221: You can multiply (or add/subtract/divide) all cells in the pasted on range by
(to/by/from) the value of the copied cell

Paste Special
221
14.3.B MULTIPLYING/DIVIDING THE CELL VALUES IN CELLS IN
SEVERAL PASTED ON COLUMNS WITH THE VALUES OF THE
COPIED RANGE
You can use the same method to add/subtract/multiply/divide one
columns (or rows) values to the corresponding cells in one or several
pasted on columns (or rows).
Copy the cells in column E and paste special onto the
cells in columns C and D choosing the option Add in the area
Operation of the paste special dialog. (You can use EDIT/UNDO to
restore the file to its old state.)
14.4 SWITCHING ROWS TO COLUMNS
Choose any option in the Paste and Operations areas and choose the
option Transpose. If pasting a range with many columns and rows you
may prefer to paste onto one cell to avoid getting the error Copy and
Paste areas are in different shapes.


Index
223
CHAPTER 15

SAVING OR TRANSFORMING TO
SPECIAL WEB AND DOCUMENT
FORMATS
This chapter shows how to save/convert Excel files to the following
formats:
PDF
WEB (HTML, WEB ARCHIVE)
XML
15.1 CONVERTING TO A PDF (ADOBE ACROBAT) FILE
The PDF format has become popular for distributing reports, especially
over the Internet. The format has some advantages over an Excel/Word
file format:
The PDF file has better security measures you can create a
file that cannot be printed, copied, or from which material cannot
be extracted.
The file looks the same on all computers, and
Managing & Tabulating Data in Excel
224
Users are less hesitant to download PDF files (compared to
Microsoft Office files) because of the lower risk of downloading a
virus.
Adobe offers several tools for converting to PDF format. Check out their
web site adobe.com.
15.1.A CREATING A PDF (ADOBE ACROBAT) FILE FROM THE
PRINTOUT
I now discuss one of the tools you can use to convert to PDF. The tool is a
PDF Printer Driver. With this tool, you print your file into a PDF file.

You will see the option Acrobat PDF Writer as one of the printers in the
area Name as shown at the top of the next figure.
Note:
The PDF Printer Driver is sold at Adobe.com and third-part vendors.
Index
225
Figure 222: PDF Writer

Choose the Acrobat PDF Writer printer option, and the options you
desire in the areas Print range and Print what of the Print dialog
which is reproduced above. Execute the dialog by clicking on the button
OK. The Save PDF File As dialog shown in the next figure opens.
Choose a location for the PDF file and write in a file name. Execute the
dialog by clicking on the button OK. The Excel file will be printed out as
a PDF file.
Selecting the check-box View PDF File will follow the printing task with
a display of the file within the Adobe Acrobat Reader.
Managing & Tabulating Data in Excel
226
Figure 223: Save PDF As dialog

15.1.B OTHER TOOLS FOR CONVERTING ONE OR MULTIPLE FILES
INTO PDF
Adobe offers several tools for converting to PDF format. Check out their
web site adobe.com.
15.2 SAVING AS AN HTML FILE
An Excel worksheet, chart, or the entire workbook can be saved as an
HTML file. This file can be placed on the web. It opens in any web
browser like Internet Explorer, Netscape, Opera, or AOL.
Index
227
Figure 224: Saving as a web page

Access the feature through the menu path FILE/SAVE AS WEB PAGE.
Choose what you want to include in the HTML file. Click on the button
Save.
15.2.A INTERACTIVITY WHEN SAVING A WORKSHEET
If you want visitors to the web site to be able to work on Excel data while
inside a browser application, then click on the option Add interactivity.
This option only works if you are choosing to save one Excel worksheet or
chart as an HTML file see the next figure.
Inquire whether FP extensions or Microsoft Office extensions
are needed for this. (Not all web hosts support this functionality.) This
Managing & Tabulating Data in Excel
228
remarkable feature adds Excellike functionality to data displayed on a
web page!
Figure 225:
Adding Interactivity

In the area Viewing options, choose what kind of interactivity you desire
Spreadsheet or Pivot Report. If the current worksheet is not a Pivot
Report then you should choose Spreadsheet Functionality
Refer to the next section to learn how to use this interactivity after
opening the file in a web browser.
Figure 226: The two modes of Interactivity

At this stage, you will be prompted to write a web page title. Type a title
and execute the dialog by clicking on the button OK.
Excel will prompt you to enter information about the specific range of
data you need on the HTML file. This is shown in the figure below see
the area Choose at the top of the dialog.
Index
229
Figure 227: Setting a title for the web page

Figure 228: Choose the range of cells to publish as a web page

Click on the option Publish to complete the process of creating the
HTML file.
15.2.B INTERACTIVITY WHEN SAVING A CHART
Assume you are saving a chart as an HTML file. Choose the chart and
choose the menu option FILE/SAVE AS WEB PAGE. Choose the option
Managing & Tabulating Data in Excel
230
Add interactivity, type in a name for the HTML file, choose a path for
saving the file, and then click on Save.
Figure 229: Saving a Chart with Interactivity

In the dialog that opens (shown in the next figure), choose the options as
shown. Click on the option Publish to complete the process of creating
the HTML file.
Figure 230: The Publish as Web Page dialog for a chart

The option Open published web page in browser will launch the default
Index
231
Internet Browser on your computer and display the file you just saved as
a web file.
15.3 NEW IN THE XP VERSION OF EXCEL: WEB
ARCHIVE FORMAT AND XML
The Web Archive format allows the saving of an entire file as on web file.
AutoRepublish facilitates easy updating of Excel files on the web. In
addition, in the XP version of Excel, you can save in XML format.
15.3.A WEB ARCHIVE
Figure 231: Saving as a Web Archive

Managing & Tabulating Data in Excel
232
I recommend selecting Add interactivity. The file may be opened in a
web browser. (For optimal compatibility, use Internet Explorer.) An
example is shown in the next illustration. The example is from the
sample file DateTime.mhtml.
Figure 232: The file viewed in a web browser

The file has several sheets. Focus on the downward arrow at the bottom
left of the previous figure. On clicking the arrow at the bottom-left, you
will see all the sheets in the file.
The next figure illustrates this feature.
Index
233
Figure 233: Viewing the sheets in the file.
Clicking on the name of a sheet opens that sheet in the web browser.

At the top of the file, you will see a short toolbar that provides access to
interactivity features. The toolbar is reproduced in the next figure.
Figure 234: The toolbar for interactivity

The toolbar icons provide access to the following features (from left to
right):
Undo
Cut
Copy
Paste
AutoSum
Sort Ascending
Sort Descending
Filter
Refresh All
Managing & Tabulating Data in Excel
234
Export to Excel
Commands & Options
Help
The second-from-right icon (Commands & Options) provides access to
many features of the file. On selecting this icon, the dialog shown in the
next figure opens.
The options in the tab Workbook provide access to features of the entire
workbook. The order of the sheets can be changed using the up and down
arrows to the right of the box that displays the sheet names.
A sheet can be deleted by selecting it in the box and then clicking on the
Delete button.
Figure 235: Workbook Commands & Options

Similarly, a new sheet can be inserted before an existing sheet by clicking
Index
235
on the button Insert. In the area Show/Hide, you can decide whether
to view the arrow that permits the selection of a sheet.
The options in the tab Sheet (reproduced in the next figure), provide:
Access to a Find utility
Options for viewing the sheet in reverse order (right to left)
Options for hiding row/column headers & Gridlines.
Figure 236: Sheet Commands & Options

The Formula tab provides access to formula editing. The area Names
maps each cell to a Location on the file.
The formulas may reference these names instead of ranges. See Volume
1: Excel For Beginners for more on Named Ranges.
The next update of this book will contain more on using Named Ranges
in formulas. Remember, that purchasing the book entitles you to one year
of monthly updates to the text and the example worksheets.
Managing & Tabulating Data in Excel
236
Figure 237: Formula Commands & Options

The Format tab provides access to the Undo command, and basic text
and cell formatting.
The dialog is reproduced in the next figure.
Macros and utilities for improved conversion of
Excel sheets into web formats. The updates will be announced on our site
by Winter 2002.
Index
237
Figure 238: Formatting Commands & Options

15.3.B XML
An Excel workbook can also be saved as an eXtended Markup Language
(XML) file.
Managing & Tabulating Data in Excel
238
Figure 239: Saving as an XML Spreadsheet

This format may gain in popularity because many other
software companies are seeking to make XML compatibility a central
feature of their products.
Detailed discussion of this topic is beyond the scope of this book.
Index
239

I NDEX
A
A1........................................................ 95
ACCESS............................................. 23
ADD-INS ............................................. 16
AND23, 40, 97, 126, 127, 174, 198, 215
ASCII198, 199, 200, 201, 202, 203, 208,
209, 213
ASCII TEXT DATA......................... 198
AUDITING........................................... 16
AUTOCORRECT...........................16, 57
AUTOFILL......................................... 68
AUTOFILTER ...........98, 100, 102, 104
AUTOFORMAT ................................... 15
AVERAGE........................................ 119
C
CELL................................159, 208, 215
CELLS .......14, 15, 40, 80, 207, 212, 215
CLEAR................................................. 13
COLUMN ......15, 97, 127, 132, 198, 215
COLUMNS ..........................14, 174, 215
COMMA........................................... 198
COMMENT ......................................... 15
COMMENTS ...............................14, 215
CONDITIONAL FORMATTING... 16, 80,
81, 84, 87, 112
CONSOLIDATION...................... 17, 124
CONSTANT GROWTH RATE......... 59
COPY.............................. 13, 56, 76, 101
COPYING AND PASTING......... 40, 97
CRITERIA ............................. 40, 80, 97
CRITERION...................................... 97
CUSTOM LIST............................ 59, 68
CUSTOMIZE................................. 16, 77
CUT.................................................... 13
D
DATA ENTRY................................... 59
DATA VALIDATION........................ 40
DAY.................................................... 23
DBASE............................................... 23
DELETE SHEET .................................. 13
DELIMITED / FREE-FIELD ASCII
TEXT DATA................................ 198
DELIMITER.................................... 198
E
EDIT...12, 56, 60, 61, 63, 64, 66, 68, 72,
73, 76, 101, 109, 113, 114, 115, 116,
117, 194, 216, 217, 218, 219, 220,
221
Managing & Tabulating Data in Excel
240
EDITING AN EXISTING QUERY 174
ERROR ALERT................................. 40
EXTERNAL DATA............... 17, 174, 175
F
F142
FILE..... 12, 23, 24, 25, 29, 30, 174, 198,
201, 208, 209, 213, 216, 227, 229
FILL.... 13, 59, 60, 61, 63, 64, 66, 68, 72,
73, 76
FILL IN NUMBERS AND DATES.. 59
FILLING FORMATS........................ 59
FILTER............ 17, 97, 98, 100, 102, 104
FIND................................................... 13
FIXED.............................................. 198
FIXED WIDTH/COLUMN ASCII TEXT
............................................. 158, 198
FORM......................... 17, 33, 34, 38, 56
FORM BASED DATA ENTRY......... 33
FORMAT15, 80, 87, 112, 198, 207, 208,
212
FORMULA ........ 14, 119, 126, 159, 215
FORMULA BAR................................... 14
FOXPRO............................................ 23
FREEZE PANES .................................. 17
FUNCTION........................... 14, 15, 126
FUNCTION / FINANCIAL .................. 14
FUNCTION / INFORMATION ............ 15
FUNCTION / LOGICAL...................... 14
FUNCTION / LOOKUP ....................... 15
FUNCTION / MATH & TRIG............... 15
FUNCTION / STATISTICAL................ 14
FUNCTION / TEXT..............................14
G
GET EXTERNAL DATA.........178, 194
GO TO13, 109, 110, 113, 114, 115, 116,
117, 118
GOAL SEEK..............................16, 171
GROUP AND OUTLINE.......................17
H
HEADER............................................14
HEADER AND FOOTER......................14
HELP...................................................18
HIDE....................................................17
HTML ......... 28, 226, 227, 228, 229, 230
HYPERLINK.........................................15
I
IF 198
IMPORT...........................................174
INSERT...............................................14
L
LINKS...................................................13
LOTUS 1 2 3 ..................................23
M
MACROS.............................................16
Index
241
MISSING VALUES........................... 59
MODE ................................................ 23
MONTHS ........................................... 59
MOVE OR COPY SHEET .................... 13
MS SQL SERVER.............................. 23
MULTIPLYING/DIVIDING/SUBTRA
CTING/ADDING ALL CELLS IN A
RANGE BY A NUMBER............ 215
N
NA....................................................... 15
NEW QUERY .................................. 178
NOT..........................................198, 215
O
OBJECT.........................................13, 15
OFFICE ASSISTANT ........................... 18
OFFICE CLIPBOARD.......................... 13
ONLINE COLLABORATION ............... 16
OPEN.........12, 23, 24, 25, 30, 201, 209
OPTIONS.................17, 68, 69, 126, 215
OR.......................................33, 174, 198
ORACLE ............................................ 23
P
PAGE BREAK .............................13, 14
PAGE BREAK PREVIEW..................... 13
PAGE SETUP....................................... 12
PARADOX.......................................... 23
PASTE..13, 56, 101, 216, 217, 218, 219,
220
PASTE SPECIAL... 13, 56, 216, 217, 218,
219, 220
PASTING ALL BUT THE BORDERS
..................................................... 215
PASTING COMMENTS ................. 215
PASTING DATA VALIDATION.... 215
PASTING ONLY FORMATS.......... 215
PASTING ONLY THE FORMULA 215
PDF..................... 28, 223, 224, 225, 226
PIVOT REPORT.. 17, 126, 127, 128, 141,
152, 174
PIVOT REPORT WIZARD ............. 126
PIVOT REPORTS ........................... 128
PRINT AREA ....................................... 12
PRINT PREVIEW................................. 12
PROPERTIES....................................... 12
PROTECTION..................................... 16
Q
QUATTROPRO ................................. 23
QUERY .................................... 174, 194
R
REDO.................................................. 12
REFRESH DATA............................ 193
REPLACE............................................ 13
RIGHT................................................ 59
ROW................... 15, 126, 127, 132, 215
ROWS ........................... 14, 97, 119, 215
Managing & Tabulating Data in Excel
242
ROWS TO COLUMNS.................... 215
S
SAS .................... 23, 24, 25, 26, 28, 127
SAVE12, 24, 25, 29, 208, 213, 227, 229
SAVE AS......... 12, 24, 25, 208, 227, 229
SAVE AS WEB PAGE ......... 12, 227, 229
SAVE WORKSPACE..................... 12, 29
SCENARIOS ............... 16, 160, 161, 168
SEARCH ............................................. 12
SHARE WORKBOOK.......................... 16
SHEET................................................. 15
SORT............................... 17, 90, 93, 120
SORTING BY ROWS........................ 89
SORTING RANGES THAT DO NOT
COVER ENTIRE COLUMNS OR
ROWS............................................ 89
SPEECH........................................ 16, 78
SPELLING........................................... 16
SPLIT .................................................. 17
SPSS .. 3, 5, 23, 24, 25, 26, 28, 127, 175
STATA............................... 5, 23, 24, 28
STATUS BAR....................................... 14
STYLE................................................. 16
SUBTOTAL..................................... 120
SUBTOTALS........................ 17, 119, 123
SUM................................................. 119
T
T 20, 23, 201
TAB.................................................. 198
TABLE .................................................17
TEXT ............................................23, 40
Text Files..........................................178
TIME ..................................................23
TOOLBAR..........................................59
TOOLBARS............................13, 77, 141
TOOLS.... 16, 68, 69, 78, 160, 161, 168,
171
TYPE ..................................................33
U
UNDO..........................................12, 221
V
VALIDATION 17, 40, 41, 42, 46, 52, 55,
56
VALUE.......................................97, 159
VIEW...............................13, 77, 86, 141
W
WEB ....................................................16
WINDOW............................................17
WORKSHEETS ....................................14
WORKSPACE....................................23
Y
YEAR..................................................59
Index
243
Z
ZOOM..................................... 14, 86, 87
Managing & Tabulating Data in Excel
244
VJ Inc Corporate and Government Training
We provide productivity-enhancement and capacity building for
corporate, government, and other clients. The onsite training includes
courses on:

Office Productivity Software and Tools

Data Mining, Statistics, Forecasting, Econometrics

Financial Analysis, Feasibility Studies

Risk Analysis, Monitoring and Management

Building and using Credit Rating/Monitoring Models

Specific software applications, including Microsoft Excel, VBA, Word,
PowerPoint, Access, Project, SPSS, SAS, STATA, ands many other
Contact our corporate training group at http://www.vjbooks.net.

Potrebbero piacerti anche