Professional Documents
Culture Documents
TABULATING DATA IN
MICROSOFT EXCEL
Learn the Power Features of Excel
SORTING, FILTERING,
PIVOT REPORTS,
DATA VALIDATION,
FORMS AND MORE
Excel for Professionals 2002-2006 VJ Books. All rights reside with the author
M
Maaan
M naaagggiiin
n nggg &
n &T
& Taaabbbu
T ulllaaatttiiin
u nggg D
n Daaatttaaa iiin
D nE
n Exxxccceeelll
E
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.
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.
2
A
ABBO
OUUTT TTH
HEE A
AUUTTH
HOORR
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.
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.
3
Managing & Tabulating Data in Excel
4
CHAPTER 1 SAVING (OPENING) IN (FROM) DIFFERENT FILE FORMATS 19
1.4 New In The XP Version Of Excel: Document Recovery And Safe Mode 24
CHAPTER 2 DATA ENTRY FORM 26
2.1 An Easier Way To Type In Data Plus A Multi-Series “Find” Utility (Data /Form) 26
2.2 Form Based Data Entry 26
2.2.a New data 26
2.3 Using The Form As A “Find” Or “Search” Utility 27
A Summary Of The Two Roles Of Data/Form 29
CHAPTER 3 REDUCING ERRORS IN DATA ENTRY— VALIDATION AND
AUTOCORRECT 32
6
Contents
9.1 Basics 91
9.2 Before making subtotals 91
9.3 Obtaining subtotals 91
9.3.a Choosing the subtotaling formula: average, sum, etc 93
9.4 Viewing only those rows that have subtotals 94
9.5 Removing subtotals 94
9.6 The “Consolidation” tool 94
CHAPTER 10 PIVOT REPORTS 97
7
Managing & Tabulating Data in Excel
11.2 Goal Seek (“If I want this cell to have a certain result, what value should that cell take)
130
11.2.a Setting the desired value for the “target” cell (the one with the formula that references
the “solution” cell) 130
11.2.b Choosing the “solution” cell 130
Running the utility 131
CHAPTER 12 LINKING TO A DATABASE 133
12.2 Linking to data from a database (or, “creating and executing a data query”) 135
12.2.a Step 1: Choosing the Database File from which data will be imported 135
12.2.b Step 2: Choosing the Columns/Fields/Variables to Import 137
Selecting fields for import into Excel 139
12.2.c Step 3: (Pre–) Filtering the data to be imported 141
12.2.d Step 4: Pre–sorting the data to be imported 145
12.2.e Step 5: Saving the Query (that is, saving steps 1–4) 146
12.2.f Step 6: Wrapping it up— getting the data into Excel 147
12.3 Refreshing the link between the Excel range and data in the database file 148
12.4 Editing an existing query 149
12.5 Using “External data source” to create a Pivot Report 149
12.6 New in the XP version of Excel: OLAP 150
8
Contents
14.1 Pasting The Result Of A Formula, But Not The Formula 164
14.2 Other Selective Pasting Options 166
14.2.a Pasting only the formula (but not the formatting and comments) 166
14.2.b Pasting only formats 167
14.2.c Pasting data validation schemes 167
14.2.d Pasting all but the borders 167
14.2.e Pasting comments only 167
14.3 Performing An Algebraic “Operation” When Pasting One Column/Row/Range On To
Another 168
14.3.a Multiplying/dividing/subtracting/adding all cells in a range by a number 168
14.3.b Multiplying/dividing the cell values in cells in several “pasted on” columns with the
values of the copied range 168
14.4 Switching Rows To Columns 168
CHAPTER 15 SAVING OR TRANSFORMING TO SPECIAL WEB AND DOCUMENT
FORMATS 170
INDEX 181
9
Managing & Tabulating Data in Excel
10
Contents
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.
11
Managing & Tabulating Data in Excel
12
Contents
13
Managing & Tabulating Data in Excel
14
Contents
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:
— Several sections within each chapter. Each section shows aspect of the
skill/tool taught in the chapter. Each section is numbered—for 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 numbered——for 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 vgupta.com. In addition, look for
updates and sign up for an infrequent newsletter at the site.
15
Managing & Tabulating Data in Excel
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.
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.
16
Contents
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.
17
Saving or transforming to special web and document formats
CHAPTER 1
SSA
AVVIIN
NGG ((O
OPPEEN
NIIN
NGG)) IIN
N ((FFRRO
OMM)) D
DIIFFFFEERREEN
NTT FFIILLEE FFO
ORRM
MAATTSS
— SAVING/OPENING TO/FROM FILE FORMATS LIKE LOTUS 1–2–3 VERSIONS 1.0 TO 4.0,
QUATTROPRO AND DBASE VERSIONS I TO IV, TEXT.
Excel XP, 2000, and 97 can open files from various file formats, including:
— Text files (delimited and fixed column width —see chapter 13 on page 152)
— 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 133.
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.
19
Managing & Tabulating Data in Excel
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.
1.1.A LOTUS 1–2–3 VERSIONS 1.0 TO 4.0, QUATTROPRO AND DBASE VERSIONS I TO IV
You can save as a Lotus 1–2–3 workbook (versions WK4 to WK1) and as different
20
Saving or transforming to special web and document formats
versions of Quattropro. Older spreadsheet formats save only the active worksheet.
dBase II–IV 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.
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.
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.
21
Managing & Tabulating Data in Excel
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.
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.
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.
22
Saving or transforming to special web and document formats
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.”
23
Managing & Tabulating Data in Excel
Figure 9: When you open the Workspace, Excel opens all the Excel files that were open when you last saved
the Workspace
A related feature is the ability to open an application in “Safe Mode,” and resolve the
problems with the application using this mode.
24
Managing & Tabulating Data in Excel
CHAPTER 2
D
DAATTA
A EEN
NTTRRYY FFO
ORRM
M
— NEW DATA
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.”
First, in the first rows of consecutive columns, enter the title for the series in that
column (as in the sample file).
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”).
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.
26
Data Entry Form
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.
27
Managing & Tabulating Data in Excel
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.)
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 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.)
28
Data Entry Form
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
Form” Enabling data entry, New: allows data Find next, Find
29
Managing & Tabulating Data in Excel
Special
Role Function Common buttons
Buttons/options
facility editing of existing data, entry for a new row previous: the criteria
deletion or addition of is defined using the
rows Delete: deletes the “Find” or “Criteria”
current row facility
Criteria: switches to
the “Criteria” or
“Find” facility
30
Managing & Tabulating Data in Excel
CHAPTER 3
RREED
DUUC
CIIN
NGG EERRRRO
ORRSS IIN
NDDA
ATTA
A EEN
NTTRRYY—
—VVA
ALLIID
DAATTIIO
ONNA
ANND
D
AAUUTTO
OCCOORRRREEC
CTT
— MESSAGE SHOWN TO PERSON ENTERING THE DATA INTO CELLS THAT HAVE “DATA
VALIDATION
— ERROR ALERT
If you are typing data straight into Excel, you may want to take steps to 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:
Further, assume you want the data to satisfy the following “validation” rules or
criteria:
32
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
3. The data in column H can only be one of the values in a chosen set of cells.
Read page 41 for the way to ensure that this criterion is set.
Select cell F1 and type in a title for the data that will be typed into this column. The
next figure illustrates this.
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.”
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.”
33
Managing & Tabulating Data in Excel
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
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.”
34
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
Step 1: Click on the downward arrow next to the box “Data1“. 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 “Maximum2“! (For obvious reasons, that box is useless if you
are looking for numbers “Greater than or equal to”!)
Step 2: Enter the second validation rule into this box as shown in Figure 21.
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 40) and
for a defined list (see Figure 107 on page 41).
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.
35
Managing & Tabulating Data in Excel
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 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
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 figure’s 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.
36
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
Figure 22: Entering text that will be seen when a person enters data into any cell within the range that has a
validation criterion
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
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.”
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
37
Managing & Tabulating Data in Excel
Assume that In cell F5 you make a mistake in typing. Notice the letter “w” — the
addition of this letter makes the entire cell “text” data and not a whole number as
required by the validation rules.
When you push down the ENTER key the error message you wrote earlier (for an
illustration of this, see Figure 23 on page 37) is displayed in a dialog (user-input
form.)
38
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
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
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.
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.
39
Managing & Tabulating Data in Excel
Step 2: Choose a “Maximum” text length of “8.” The second validation rule is defined.
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).
Figure 32: Always enter an “Error Alert” that describes the valid criteria
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.
40
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
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.
Select the entire column H and go to DATA/VALIDATION. Within the 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.
41
Managing & Tabulating Data in Excel
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.
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.
42
Reducing Errors in Data Entry – “Validation” & “Autocorrect”
Figure 39: Using the “List” Validation Criteria can save on typing
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.
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.
43
Managing & Tabulating Data in Excel
3.4 SELECTING ALL CELLS WITH THE SAME DATA VALIDATION RULE
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.
3.6 AUTOCORRECT
44
Managing & Tabulating Data in Excel
CHAPTER 4
UUSSIIN
NGG FFIILLLL A
ANND
DOOTTH
HEERR TTO
OOOLLSS TTO
O SSA
AVVEE O
ONN TTYYPPIIN
NGG TTIIM
MEE
— FILLING YEARS/INTEGERS
— FILLING FORMATS
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.
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.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.
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).
46
Using Fill & other Tools to Save Time
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 Figure 43.
Figure 43: Use the mouse to drag over the cells you want to fill
Figure 44: The menu option and sub–options 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.”
Note that Excel auto selects the “Step value” of 1. A step value of 1 implies that each
consecutive cell will have a value that is “1 + the preceding cells value.”
47
Managing & Tabulating Data in Excel
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.
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.)
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.
48
Using Fill & other Tools to Save Time
Use EDIT/FILL even if the desired series included text along with a number
sequence (for example, a series like “yr91, yr92,…, yr99”).
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.)
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.
The dialog (user-input form) that opens is shown in the next figure.
49
Managing & Tabulating Data in Excel
Note that Excel has automatically determined that the series are in a column
because you dragged the mouse down.
Execute the dialog by clicking on the button OK. Excel fills the list— the next figure
shows the filled range.
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.
50
Using Fill & other Tools to Save Time
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.
Excel fills the weekday series — the next figure shows the result.
51
Managing & Tabulating Data in Excel
You can create new “lists” that Excel will fill in automatically. Assume you have
three lists you work with often:
(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 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).
52
Using Fill & other Tools to Save Time
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 dark–bordered 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.
Choose the cells that have the list entries for one list (for example, the clients list.)
See the next figure for an illustration.
53
Managing & Tabulating Data in Excel
Figure 61: Choose the cells that have the entries for one list
Execute the dialog by clicking on the button “Import.” A new list is created as shown
in Figure 63.
54
Using Fill & other Tools to Save Time
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”
FILL is also used for replacing/filling–in missing values from a numerical series. The
methods available for filling in the missing data are:
55
Managing & Tabulating Data in Excel
Assume your data has two series: x and y as shown in the picture below— Figure 654.
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.
Highlight the cells with the missing data and the first non–missing 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.165. (For an illustration, see Figure 67.)
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
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
56
Using Fill & other Tools to Save Time
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 rate6 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.)
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).
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
57
Managing & Tabulating Data in Excel
Figure 70: The missing values are filled with numbers based upon a constant Growth rate
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.
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.
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 fill–in. 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.
58
Using Fill & other Tools to Save Time
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 often–used 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.
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.
59
“Conditional Formatting”— Color–coding data patterns
CHAPTER 5
““C
COON NDDIITTIIO
ONNA
ALL FFO
ORRM
MAATTTTIIN
NGG””—
—CCO
OLLO
ORR––C
COOD
DIIN
NGGD
DAATTA
A
PPA
ATTTTEERRN
NSS
— STEP 2: DEFINING THE FORMAT TO USE FOR CELLS THAT SATISFY THE CONDITION
Condition
Forma
5
t
61
5
Managing & Tabulating Data in Excel
Figure 74 to Figure 77 show how to set the first conditional format. Let us go
through this process systematically.
“If the value of the cell is between 10,000,000 and 12,000,000 then give the
5.4 STEP 2: DEFINING THE FORMAT TO USE FOR CELLS THAT SATISFY THE
CONDITION
Click on the button “Format7“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).
62
“Conditional Formatting”— Color–coding data patterns
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.
After clicking on the button “OK,” you will be back to the CONDITIONAL
FORMATTING dialog. (For a pictorial reproduction of this, see Figure 77).
63
Managing & Tabulating Data in Excel
Figure 77: The first condition and the concomitant formatting are defined
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.
In this example, the condition does not reference a fixed number (as in Figure 79
64
“Conditional Formatting”— Color–coding data patterns
where the fixed number is 100,000,000) but, instead, a cell on the Excel worksheet.
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.
65
Managing & Tabulating Data in Excel
5.8 SELECTING ALL CELLS WITH THE SAME CONDITIONAL FORMAT RULE
66
Managing & Tabulating Data in Excel
CHAPTER 6
SSO
ORRTTIIN
NGG
— BASIC SORTING
— CASE SENSITIVITY
— SORTING BY ROWS
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.)
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 down–arrow next to the topmost white box, and,
(b) picking a series from the list of series.
Repeat this process with a second (and, after that, a third) choice of series name in
68
Sorting
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.
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
The result is shown in Figure 86. The data is sorted— first by “Country Name,” then
by “Series Name.”
69
Managing & Tabulating Data in Excel
Figure 86: Compare the Sorted data with the original data shown in Figure 83
Click on the button Options. The dialog (user-input form) that opens is shown in
Figure 87. Within this box, you can fine–tune 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.”
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).
70
Sorting
Figure 88: Sorting by rows — click on the “Options button and… (see next figure)
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).
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.
71
Managing & Tabulating Data in Excel
Figure 90: The dialog for Sorting when you are sorting by 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.
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.
72
Sorting
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.
73
Filter ("Hiding the Data you do not want to View")
CHAPTER 7
FFIILLTTEERR ((““H
HIID
DIIN
NGG TTH
HEE D
DAATTA
A YYO
OUU D
DOON
NOOTT W
WAAN
NTT TTO
O
VVIIEEW W””))
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 (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.
Open the sample data file supplied8 in the zipped file and work along with the
section.
8 The sample is in one of the Excel files provided in the zipped file: ““Advanced
File2.xls.”
75
Managing & Tabulating Data in Excel
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.)
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:
• “(Top 10)” chooses the rows that have the 10 most occurring values in that
column.
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.
76
Filter ("Hiding the Data you do not want to View")
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 non–consequent numbers
(3, 16, 29, etc.) as highlighted by the rectangle in Figure 95. The “unfiltered” (or
“Filtered out”) rows are hidden9.
Figure 95: The results of a simple Filter— one-value criteria for one data series
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
category10 you chose in the Filter. (For an illustration of this, see Figure 96.)
77
Managing & Tabulating Data in Excel
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.
Typically, one would use a more complex Filter. These are created using the option
“Custom.” Thus, this time click on the option “(Custom).”
7.3.A EXAMPLE OF A FILTER THAT HAS TWO CRITERIA OVER ONE SERIES/COLUMN
78
Filter ("Hiding the Data you do not want to View")
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).
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.
You can also filter using criteria from more than one series.
79
Managing & Tabulating Data in Excel
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 101: Defining the custom AutoFilter for the second column used in this complex “Filter based on 2–
column/series”
The worksheet will only show the data that corresponds to both the multi–column
80
Filter ("Hiding the Data you do not want to View")
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.
You may insert or delete columns while the sheet is in filter mode.
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 often–used 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.
11 The two Filters are shown in Figure 611 and Figure 613.
81
Managing & Tabulating Data in Excel
82
Managing & Tabulating Data in Excel
CHAPTER 8
SSEELLEEC
CTTIIN
NGGA ALLLL C
CEELLLLSS//CCO ONNTTEEN
NTT A AC CRROOSSSS TTH
HEE
WWO ORRKKSSH HEEEETT TTH
HAATT SSA
ATTIISSFFYY A
AC CRRIITTEERRIIO
ONN
Excel’s “Go To- Special” feature allows you to make smart range selections without
programming. Using the mouse, select the menu path EDIT/GO TO.
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.
84
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
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.
85
Managing & Tabulating Data in Excel
— “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.
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,
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.
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
This topic requires knowledge about “Data Validation,” a topic taught in Volume 4:
Managing & Tabulating Data in Excel.
Step 1:
86
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
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.
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
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
87
Managing & Tabulating Data in Excel
Step 2:
Select one of these four options
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
•
Step 2:
Select one of these four options.
Note:
Date and Time functions evaluate to a serial number that corresponds to a specific
point on the time continuum. Thus, they are “Numbers.”
88
Selecting all Cells/content across the Worksheet that Satisfy aCriterion
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:
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 cell’s formula.
These referenced cells are called “Precedents.”
89
Managing & Tabulating Data in Excel
Step 1:
Pick the menu option EDIT/GO TO, click on the button “Special.” Select the option
“Precedents” in the dialog that opens.
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.
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.)
90
Subtotals
CHAPTER 9
SSUUBBTTO
OTTA
ALLSS
— OBTAINING SUBTOTALS
— REMOVING SUBTOTALS
9.1 BASICS
Subtotal adds new rows that capture sub–totals for groups defined by consecutive
rows. If you want to make a table with only the sub–totals (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 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
Access the feature through the menu path DATA/SUBTOTAL. The dialog (user-
91
Managing & Tabulating Data in Excel
In the area “at each change in” define the criterion for the sub–totals. (The examples
are shown in Figure 115 and Figure 117). Choose “at each change in 'Country
Name’.” That is, when a new category12 is found, then the sub–total of the previous
category is inserted.
Choose the columns whose data you want sub–totaled— click to the left of the
column/series name in the area “Add subtotal to.” (For an illustration, see Figure
117.)
92
Subtotals
Click on the arrow next to “Use function” and choose the aggregate function as shown
in Figure 11813.
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 84.
93
Managing & Tabulating Data in Excel
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).
Use the “group collapsing minus indicators” taught in Volume 1: Excel For Beginners
to view only those rows that contain totals.
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.”
94
Subtotals
95
Pivot Reports
CHAPTER 10
PPIIV
VOOTT RREEPPO
ORRTTSS
— EDITING FIELDS
— SELECTING A FIELD
— DELETING A FIELD
— PIVOT REPORT EXAMPLE WITH A THIRD DIMENSION (ROW, COLUMN, AND PAGE)
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.
I will take you through an example to illustrate how to make a Pivot Report. Please
97
Managing & Tabulating Data in Excel
experiment on the sample data set14 included in the zipped file you downloaded.
Access the feature through the menu path DATA/PIVOT REPORTS (Excel 97) or
DATA/PIVOT REPORTS and PIVOT CHART REPORT (Excel XP).
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
List16,17.
14 The sample data set is on sheet “base” in the file “Sample Pivot1.xls.”
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 120 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.
98
Pivot Reports
Figure 123: The first dialog of the Pivot wizard in the XP version of Excel
Figure 124: Excel XP and later versions provide the option of creating charts in additions to tables
99
Managing & Tabulating Data in Excel
A small dialog opens (for an illustration of this, see Figure 125). With the mouse,
highlight the data18 you want summarized in the Pivot Report19. This step of the
wizard has been completed.
Figure 125: The dialog for step two of the Pivot wizard
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.)
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.
100
Pivot Reports
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.
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
101
Managing & Tabulating Data in Excel
“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.”
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
102
Pivot Reports
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.
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.)
103
Managing & Tabulating Data in Excel
The use of the area “PAGE” will be shown in 10.3 on page 116. This step of the
wizard has been completed. Move on to the next step/dialog by clicking on the button
Next.
104
Pivot Reports
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.
• Merge labels: experiment and judge if merging labels makes the table easier
to read.
• For error values, show: you can choose to have errors displayed as blanks, or
with a special notation like “#Error.”
105
Managing & Tabulating Data in Excel
• 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 re–open the file and want to complete
the Pivot Report.
• 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.
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.
106
Pivot Reports
You have already run a Pivot on this data— do you notice the Pivot worksheets for
the old Pivot?
107
Managing & Tabulating Data in Excel
The story is not over! Pivot Reports are very powerful because
(1) You can make graphs and calculate statistics at a more aggregate level 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) – 2nd from left in top
row of icons
— Change the Function choices (shown in Figure 130) – 3rd 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 116, this allows you to make separate worksheets for each category
of the PAGE series – – 4th from left in top row of icons
Pivot Reports can be modified further. Click anywhere on the Pivot Report and then
click on the right mouse.
20 If you do not see this toolbar, choose the menu option VIEW / TOOLBARS and choose
PIVOT REPORT.
108
Pivot Reports
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...”
The other options in the shortcut menu are beyond the scope of this book.
109
Managing & Tabulating Data in Excel
(Nevertheless, if you feel confident, play around with the options “Select” and
“Options.”)
Let us insert a new function/field to the Pivot Report. The function is “percentage
change from 1995 to 200021.”
Choose the option “Insert” from the shortcut menu shown in Figure 139. The dialog
shown in Figure 141 opens.
First, as shown in the next figure, write the name of the new function.
110
Pivot Reports
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.
Figure 144: Typing the formula for the new data field— 2
Figure 145: Typing the formula for the new data field— 3
Figure 146: Typing the formula for the new data field— 4
Figure 147: Typing the formula for the new data field— 6
Figure 148: Typing the formula for the new data field— 7
111
Managing & Tabulating Data in Excel
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.
The rows labeled “Sum of Change 95— 2000” were not in the original Pivot Report.
Compare this figure with Figure 137.
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 click–and–drag (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
112
Pivot Reports
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.
Figure 152: Selecting all the data and labels for one data field
113
Managing & Tabulating Data in Excel
Figure 153: The shortcut menu for modifying/formatting the cells for one data field
Choose the option “Format Cells22.” The dialog shown in Figure 154 opens. Choose
the number format of “percentage.”
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.
114
Pivot Reports
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.”
Figure 155: The number format of the data has been changed
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 pop–up menu that appears.
115
Managing & Tabulating Data in Excel
The “Delete” option removes (from the Pivot Report) the selected field.
The option “Refresh Data” re–creates the Pivot Report. This option is useful if there
is any change in the data on which the table is based.
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 two–
dimensional Pivot Report, and then click on the right mouse.
From the options in the pop–up menu, select the option “Wizard.” Change the design
by dragging and dropping the buttons for each series. In the 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
116
Pivot Reports
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), you see a downward
arrow (and the text “(All).”
Figure 157: Using the Filter dropdown box for viewing each “page” in a three–dimensional Pivot Report —
1
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 three–dimensional Pivot Report —
2
Therefore, when you do a “3–D” Pivot Report, you are creating several Pivot Reports,
one for each of the categories in the series placed in the “Page” area.
117
Managing & Tabulating Data in Excel
Figure 159: Using the Filter dropdown box for viewing each “page” in a three–dimensional Pivot Report —
3
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.
Figure 160: Making a new worksheet for each category of the variables in the third dimension
In Excel XP, you can also request Charts from the results of the Pivoting procedure.
Excel will produce multiple charts for a three–dimension Pivot layout (that is, a row,
column, and page dimension).
118
Pivot Reports
XP has the new features of item properties and Online Analytical Processing (OLAP).
These topics are beyond the scope of this book.
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 often–used 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.
119
“If-then” Analysis: Scenarios & Goal Seek
CHAPTER 11
““IIFF--TTH
HEEN
N”” A
ANNA
ALLYYSSIISS:: SSC
CEEN
NAARRIIO
OSS A
ANND
DGGO
OAALL SSEEEEKK
— SETTING THE DESIRED VALUE FOR THE “TARGET” CELL (THE ONE WITH THE FORMULA
THAT REFERENCES THE “SOLUTION” CELL)
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 “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.”
121
Managing & Tabulating Data in Excel
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.
122
“If-then” Analysis: Scenarios & Goal Seek
A comment has been added to explain the scenario. All the other options are the
defaults — I recommend sticking with them.
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
123
Managing & Tabulating Data in Excel
The two scenarios are defined. The dialog shows the two scenarios. The dialog is
reproduced in the next figure.
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”).
124
“If-then” Analysis: Scenarios & Goal Seek
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”).
Scenario summary
At this stage, the use of scenarios is not very useful because you can only 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.
125
Managing & Tabulating Data in Excel
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.
Figure 171: The “Scenario Summary” is created and displayed on a new worksheet
126
“If-then” Analysis: Scenarios & Goal Seek
Experiment with using these indicators to learn more about “Grouping and
Outlining,” a skill taught in Volume 1: Excel For Beginners.
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.”)
127
Managing & Tabulating Data in Excel
Figure 174: Re-expand the rows by clicking on the two “plus” indicators for the rows
Choose the option “Scenario Pivot” and the cells whose values you want use in the
data region of the Pivot.
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.
128
“If-then” Analysis: Scenarios & Goal Seek
• The number of “pages” in the Pivot is defined by the number of users who
have defined assumption cells.
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.
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
129
Managing & Tabulating Data in Excel
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 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.
You want F4 to achieve the given value by changing the value in cell D4. So enter D4
130
“If-then” Analysis: Scenarios & Goal Seek
23 Alternatively, click on the box marked by the arrow and then choose the cell from
the sheet.
131
Linking to a Database
CHAPTER 12
LLIIN
NKKIIN
NGG TTO
OAAD
DAATTA
ABBA
ASSEE
— 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
— REFRESHING THE LINK BETWEEN THE EXCEL RANGE AND DATA IN THE DATABASE FILE
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.
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
133
Managing & Tabulating Data in Excel
cells will automatically be updated24— 12.3 on page 148 illustrates the ease of
refreshing the data link (also called “updating the query.”)
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 149, 12.4 introduces editing a pre–defined 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”
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.
Table1 Table1.Field1
Table1.Field2
Database1 Table2
Table1.Field3
Table3 Table1.Field4
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.)
134
Linking to a Database
Database Excel
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”).
Open a new Excel file. Follow the six steps described in the rest of this 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.
135
Managing & Tabulating Data in Excel
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 shown26.
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.
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
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 135
136
Linking to a Database
through the network of drives and choose the Access file that has the source data27.
(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.
Figure 183: Step one of the Query wizard— choosing the path and name of the database file
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”).
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.
137
Managing & Tabulating Data in Excel
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
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.
138
Linking to a Database
Figure 186: Step two of the Query wizard (choosing the data series to import)— 3
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 Excel
worksheet. So, if you choose X number of columns/fields, you will import X columns
in Excel.
139
Managing & Tabulating Data 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.)
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.
140
Linking to a Database
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.
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).
141
Managing & Tabulating Data in Excel
Figure 190: Step three of the Query wizard (setting the criteria for selecting the observations to be
imported)— 2
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
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.
142
Linking to a Database
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.
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.”
143
Managing & Tabulating Data in Excel
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.
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.)
144
Linking to a Database
Figure 195: Step three of the Query wizard (setting the criteria for selecting the observations to be
imported)— 7
This step of the wizard has been completed. Move to the next step/dialog by clicking
on the button Next.
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.
145
Managing & Tabulating Data in Excel
Figure 196: Step four of the Query wizard (pre–Sorting the data to be imported)
You have completed step four of the process. Move to step five by clicking on the
button Next.
12.2.E STEP 5: SAVING THE QUERY (THAT IS, SAVING STEPS 1–4)
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
146
Linking to a Database
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 wizard’s
last dialog (shown in Figure 197).
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.)
147
Managing & Tabulating Data in Excel
Figure 200: Step six of the Query wizard (getting the data into Excel)— 2
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.
148
Linking to a Database
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 99.
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.
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 99 and footnote 17 on page 98). 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.
149
Managing & Tabulating Data in Excel
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.
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 often–used 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.
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.
150
Managing & Tabulating Data in Excel
CHAPTER 13
RREEA
ADDIIN
NGGA
ASSC
CIIII TTEEX
XTT D
DAATTA
A
Contents of chapter:
— FIXED–WIDTH/COLUMN
— DELIMITED/FREE-FIELD
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.
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).
152
Reading ASCII Text Data
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.
When ASCII data is being entered, data–entry involves typing the data for variables
next to each other while separating different variables by a standard character28
(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.
Fixed–width/Column29
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 data–entry 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.
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 YG U P T A
153
Managing & Tabulating Data in Excel
Delimited/Free-Field
In this ASCII Text format, spaces, tabs, commas, or semi–colons separate data series.
That is, after entering the data for one of the variables, the data–entry 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.
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 comma–
delimited file.
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.
Irrespective of the file extension, Excel automatically recognizes the file as an ASCII
Text file, and, consequently, launches the 1st dialog of the “Text Import Wizard”
(shown in Figure 205).
154
Reading ASCII Text Data
The file could have either of the two broad categories of formats: delimited (also
called “free–field”), or fixed–width (also called “fixed-column”).
The Excel Wizard 'senses' that the ASCII Text file is of the delimited type.
Therefore, it selects the option “Delimited” in the area “Original data type30.”
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.)
155
Managing & Tabulating Data in Excel
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.
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.
156
Reading ASCII Text Data
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.)
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 issues dealt
better in Excel— outside of the “Text Import Wizard32.” Therefore, just click on the
32 Using the menu option FORMAT / CELLS and the key DELETE.
157
Managing & Tabulating Data in Excel
button Finish.
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
158
Reading ASCII Text Data
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 columns to which you want to
apply the same formatting and then press the F4 key.)
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 1st 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 type33.”
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.)
159
Managing & Tabulating Data in Excel
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.”)
Figure 213: Step two of the Text Import wizard for Fixed-width data — 1
160
Reading ASCII Text Data
Excel often makes errors in picking the demarcation points. Use the mouse to set the
correct column widths.
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 Wizard34.”
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.
161
Managing & Tabulating Data in Excel
Figure 215: Step three of the Text Import wizard for Fixed-width Text data
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.
162
Managing & Tabulating Data in Excel
CHAPTER 14
PPA
ASSTTEE SSPPEEC
CIIA
ALL
— PASTING ONLY THE FORMULA (BUT NOT THE FORMATTING AND COMMENTS)
This less known feature of Excel has some great options that save time and reduce
annoyances in copying and pasting.
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.)
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.
164
Paste Special
Figure 217: The PASTE SPECIAL dialog in Excel versions prior to Excel XP
165
Managing & Tabulating Data in Excel
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.
166
Paste Special
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.
Refer to Volume 1: Excel for Beginners for a discussion on the format painter.
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.
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.
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.
167
Managing & Tabulating Data in Excel
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
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 column’s (or row’s)
values to the corresponding cells in one or several “pasted on” columns (or rows).
Try This: 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.)
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.”
168
Managing & Tabulating Data in Excel
CHAPTER 15
SSA
AVVIIN
NGGO ORR TTRRA
ANNSSFFO
ORRMMIIN
NGG TTO
O SSPPEEC
CIIA
ALL W
WEEBB A
ANND
D
DDO
OC CUUMMEEN
NTT FFOORRM
MA ATTSS
This chapter shows how to save/convert Excel files to the following formats:
— XML
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.
Adobe offers several tools for converting to PDF format. Check out their web site
adobe.com.
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.
170
Index
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.
171
Managing & Tabulating Data in Excel
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.
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.
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.”
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.
Note: Inquire whether FP extensions or Microsoft Office extensions are needed
for this. (Not all web hosts support this functionality.) This remarkable feature
adds Excel–like functionality to data displayed on a web page!
172
Index
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.
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.
173
Managing & Tabulating Data in Excel
Click on the option “Publish” to complete the process of creating the HTML file.
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 “Add interactivity,”
type in a name for the HTML file, choose a path for saving the file, and then click on
“Save.”
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.
174
Index
The option “Open published web page in browser” will launch the default 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.
175
Managing & Tabulating Data in Excel
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.”
176
Index
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.
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.
177
Managing & Tabulating Data in Excel
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
• Export to Excel
• Help
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.
178
Index
Similarly, a new sheet can be inserted before an existing sheet by clicking 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.
The “Formula” tab provides access to formula editing. The area “Names” maps each
cell to a “Location” on the file.
179
Managing & Tabulating Data in Excel
The formulas may reference these names instead of ranges. See Volume 1: Excel For
Beginners for more on “Named Ranges.”
The “Format” tab provides access to the Undo command, and basic text and cell
formatting.
180
Index
15.3.B XML
An Excel workbook can also be saved as an “eXtended Markup Language” (XML) file.
This format may gain in popularity because many other software companies are seeking to
make XML compatibility a central feature of their products.
181
Managing & Tabulating Data in Excel
INDEX
ERROR ALERT.......................................................... 40
A
EXTERNAL DATA.................................... 17, 174, 175
A1 95
ACCESS ...................................................................... 23 F
ADD-INS..................................................................... 16 F1 42
AND ........................23, 40, 97, 126, 127, 174, 198, 215 FILE......12, 23, 24, 25, 29, 30, 174, 198, 201, 208, 209,
ASCII.........198, 199, 200, 201, 202, 203, 208, 209, 213 213, 216, 227, 229
ASCII TEXT DATA ................................................. 198 FILL.................13, 59, 60, 61, 63, 64, 66, 68, 72, 73, 76
AUDITING ................................................................. 16 FILL IN NUMBERS AND DATES ........................... 59
AUTOCORRECT ................................................. 16, 57 FILLING FORMATS ................................................. 59
AUTOFILL ................................................................. 68 FILTER ................................... 17, 97, 98, 100, 102, 104
AUTOFILTER .................................... 98, 100, 102, 104 FIND............................................................................ 13
AUTOFORMAT ......................................................... 15 FIXED ....................................................................... 198
AVERAGE ................................................................ 119 FIXED WIDTH/COLUMN ASCII TEXT ....... 158, 198
FORM.................................................. 17, 33, 34, 38, 56
C FORM BASED DATA ENTRY................................. 33
CELL ......................................................... 159, 208, 215 FORMAT ................ 15, 80, 87, 112, 198, 207, 208, 212
CELLS ............................... 14, 15, 40, 80, 207, 212, 215 FORMULA ................................. 14, 119, 126, 159, 215
CLEAR ........................................................................ 13 FORMULA BAR ........................................................ 14
COLUMN.............................. 15, 97, 127, 132, 198, 215 FOXPRO ..................................................................... 23
COLUMNS ................................................. 14, 174, 215 FREEZE PANES......................................................... 17
COMMA.................................................................... 198 FUNCTION................................................... 14, 15, 126
COMMENT................................................................. 15 FUNCTION / FINANCIAL........................................ 14
COMMENTS ...................................................... 14, 215 FUNCTION / INFORMATION ................................. 15
CONDITIONAL FORMATTING ..... 16, 80, 81, 84, 87, FUNCTION / LOGICAL............................................ 14
112
FUNCTION / LOOKUP ............................................. 15
CONSOLIDATION ............................................ 17, 124
FUNCTION / MATH & TRIG ................................... 15
CONSTANT GROWTH RATE ................................. 59
FUNCTION / STATISTICAL .................................... 14
COPY ...................................................... 13, 56, 76, 101
FUNCTION / TEXT ................................................... 14
COPYING AND PASTING ................................. 40, 97
CRITERIA....................................................... 40, 80, 97 G
CRITERION................................................................ 97 GET EXTERNAL DATA................................. 178, 194
CUSTOM LIST..................................................... 59, 68 GO TO .........13, 109, 110, 113, 114, 115, 116, 117, 118
CUSTOMIZE ........................................................ 16, 77 GOAL SEEK....................................................... 16, 171
CUT ............................................................................. 13 GROUP AND OUTLINE ........................................... 17
D H
DATA ENTRY............................................................ 59 HEADER..................................................................... 14
DATA VALIDATION................................................ 40 HEADER AND FOOTER .......................................... 14
DAY ............................................................................ 23 HELP ........................................................................... 18
DBASE ........................................................................ 23 HIDE............................................................................ 17
DELETE SHEET ........................................................ 13 HTML.................................. 28, 226, 227, 228, 229, 230
DELIMITED / FREE-FIELD ASCII TEXT DATA 198 HYPERLINK .............................................................. 15
DELIMITER ............................................................. 198
I
E IF 198
EDIT .......12, 56, 60, 61, 63, 64, 66, 68, 72, 73, 76, 101, IMPORT.................................................................... 174
109, 113, 114, 115, 116, 117, 194, 216, 217, 218, INSERT ....................................................................... 14
219, 220, 221
EDITING AN EXISTING QUERY ......................... 174
182
Index
L R
LINKS.......................................................................... 13 REDO........................................................................... 12
LOTUS 1– 2– 3............................................................ 23 REFRESH DATA...................................................... 193
REPLACE.................................................................... 13
M
RIGHT ......................................................................... 59
MACROS..................................................................... 16
ROW ............................................15, 126, 127, 132, 215
MISSING VALUES .................................................... 59
ROWS ....................................................14, 97, 119, 215
MODE.......................................................................... 23
ROWS TO COLUMNS............................................. 215
MONTHS..................................................................... 59
MOVE OR COPY SHEET.......................................... 13 S
MS SQL SERVER....................................................... 23 SAS ..............................................23, 24, 25, 26, 28, 127
MULTIPLYING/DIVIDING/SUBTRACTING/ADDIN SAVE .........................12, 24, 25, 29, 208, 213, 227, 229
G ALL CELLS IN A RANGE BY A NUMBER215 SAVE AS.................................12, 24, 25, 208, 227, 229
N SAVE AS WEB PAGE ...............................12, 227, 229
NA 15 SAVE WORKSPACE ........................................... 12, 29
NEW QUERY............................................................178 SCENARIOS .......................................16, 160, 161, 168
NOT ...................................................................198, 215 SEARCH...................................................................... 12
SHARE WORKBOOK................................................ 16
O SHEET ......................................................................... 15
OBJECT.................................................................13, 15 SORT .......................................................17, 90, 93, 120
OFFICE ASSISTANT ................................................. 18 SORTING BY ROWS................................................. 89
OFFICE CLIPBOARD................................................ 13 SORTING RANGES THAT DO NOT COVER
ONLINE COLLABORATION ................................... 16 ENTIRE COLUMNS OR ROWS ......................... 89
OPEN ...................................12, 23, 24, 25, 30, 201, 209 SPEECH................................................................. 16, 78
OPTIONS.........................................17, 68, 69, 126, 215 SPELLING................................................................... 16
OR 33, 174, 198 SPLIT........................................................................... 17
ORACLE...................................................................... 23 SPSS.............................3, 5, 23, 24, 25, 26, 28, 127, 175
STATA.........................................................5, 23, 24, 28
P
STATUS BAR ............................................................. 14
PAGE BREAK ......................................................13, 14
STYLE ......................................................................... 16
PAGE BREAK PREVIEW ......................................... 13
SUBTOTAL............................................................... 120
PAGE SETUP.............................................................. 12
SUBTOTALS ..............................................17, 119, 123
PARADOX .................................................................. 23
SUM........................................................................... 119
PASTE .................. 13, 56, 101, 216, 217, 218, 219, 220
PASTE SPECIAL ......... 13, 56, 216, 217, 218, 219, 220 T
PASTING ALL BUT THE BORDERS ....................215 T 20, 23, 201
PASTING COMMENTS...........................................215 TAB............................................................................ 198
PASTING DATA VALIDATION ............................215 TABLE......................................................................... 17
PASTING ONLY FORMATS ..................................215 TEXT ..................................................................... 23, 40
PASTING ONLY THE FORMULA.........................215 Text Files ................................................................... 178
PDF ..............................................28, 223, 224, 225, 226 TIME............................................................................ 23
PIVOT REPORT ........ 17, 126, 127, 128, 141, 152, 174 TOOLBAR................................................................... 59
PIVOT REPORT WIZARD ......................................126 TOOLBARS ..................................................13, 77, 141
PIVOT REPORTS .....................................................128 TOOLS.......................16, 68, 69, 78, 160, 161, 168, 171
PRINT AREA .............................................................. 12 TYPE............................................................................ 33
PRINT PREVIEW ....................................................... 12
U
PROPERTIES .............................................................. 12
UNDO .................................................................. 12, 221
PROTECTION............................................................. 16
V
Q
VALIDATION ..................17, 40, 41, 42, 46, 52, 55, 56
QUATTROPRO........................................................... 23
VALUE ................................................................ 97, 159
QUERY..............................................................174, 194
VIEW .......................................................13, 77, 86, 141
183
Managing & Tabulating Data in Excel
W Y
WEB ............................................................................ 16 YEAR .......................................................................... 59
WINDOW.................................................................... 17
Z
WORKSHEETS .......................................................... 14
ZOOM ............................................................. 14, 86, 87
WORKSPACE ............................................................ 23
184