Excel 2003 Bible · 2013-07-23 · Excel user needs to know and the more complex topics that will...

30

Transcript of Excel 2003 Bible · 2013-07-23 · Excel user needs to know and the more complex topics that will...

Excel 2003 Bible

01 539671 FM.qxd 8/28/03 9:59 AM Page i

01 539671 FM.qxd 8/28/03 9:59 AM Page ii

Excel 2003 Bible

John Walkenbach

01 539671 FM.qxd 8/28/03 9:59 AM Page iii

Excel 2003 Bible

Published byWiley Publishing, Inc.10475 Crosspoint BoulevardIndianapolis, IN 46256www.wiley.com

Copyright © 2003 by Wiley Publishing, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-0-7645-3967-1

Manufactured in the United States of America

16 15 14 13 12 11 10 9

1B/RY/QZ/QT/IN

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 ofthe 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization throughpayment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978)750-8400, fax (978) 646-8700. Requests to the Publisher for permission should be addressed to the Legal Department, WileyPublishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, E-Mail:[email protected].

is a trademark of Wiley Publishing, Inc.

LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: WHILE THE PUBLISHER AND AUTHOR HAVE USED THEIR BESTEFFORTS IN PREPARING THIS BOOK, THEY MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THEACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS BOOK AND SPECIFICALLY DISCLAIM ANY IMPLIEDWARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATEDOR EXTENDED BY SALES REPRESENTATIVES OR WRITTEN SALES MATERIALS. THE ADVICE AND STRATEGIESCONTAINED HEREIN MAY NOT BE SUITABLE FOR YOUR SITUATION. YOU SHOULD CONSULT WITH APROFESSIONAL WHERE APPROPRIATE. NEITHER THE PUBLISHER NOR AUTHOR SHALL BE LIABLE FOR ANY LOSSOF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL,CONSEQUENTIAL, OR OTHER DAMAGES. FULFILLMENT OF EACH COUPON OFFER IS THE SOLE RESPONSIBILITY OFTHE OFFEROR.

For general information on our other products and services or to obtain technical support, please contact our CustomerCare Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available inelectronic books.

Library of Congress Control Number: 2003101915

Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trademarks of John Wiley & Sons,Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. All othertrademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product orvendor mentioned in this book.

539671 FM_9.qxd 8/4/08 12:07 PM Page iv

About the AuthorJohn Walkenbach is the author of approximately three dozen spreadsheet books.Visit his Web site at http://.j-walk.com.

01 539671 FM.qxd 8/28/03 9:59 AM Page v

CreditsAcquisitions ManagerGregory S. Croy

Project EditorLinda Morris

Technical EditorBill Manville

Senior Copy EditorDiana R. Conover

Editorial ManagerKevin Kirschner

Vice President & Executive GroupPublisherRichard Swadley

Vice President and PublisherAndy Cummings

Editorial DirectorMary C. Corder

Project CoordinatorErin Smith

Graphics and Production SpecialistsCarrie FosterLeAndra HosierMichael KruzilLynsey OsbornHeather PopeMary Gillot Virgin

Quality Control TechniciansLaura AlbertSusan MoritzCarl William PierceBrian H. Walls

Senior Permissions EditorCarmen Krikorian

Media Development SpecialistGreg Stafford

Proofreading and IndexingTECHBOOKS Production Services

01 539671 FM.qxd 8/28/03 9:59 AM Page vi

Preface

Thanks for purchasing the Excel 2003 Bible. My goal in writing this book is toshare with you some of what I know about Excel, and in the process, make you

more efficient on the job.

The book contains everything that you need to know to learn the basics of Exceland then move on to more advanced topics at your own pace. You’ll find many use-ful examples and lots of tips and tricks that I’ve accumulated over the years.

Is This Book for You?The Bible series from Wiley Publishing, Inc. is designed for beginning, intermediate,and advanced users. This book covers all the essential components of Excel andprovides clear and practical examples that you can adapt to your own needs.

In this book, I’ve tried to maintain a good balance between the basics that everyExcel user needs to know and the more complex topics that will appeal to powerusers. I’ve used Excel for many years, and I realize that almost everyone still hassomething to learn (including myself). My goal is to make that learning an enjoyableprocess.

Software VersionsThis book was written for Excel 2003 for Windows. However, Excel hasn’t reallychanged much lately, so most of the information also applies to earlier versions andalso to the Macintosh version. If you use a version prior to Excel 97, you’ll find thata significant portion of this book does not apply.

01 539671 FM.qxd 8/28/03 9:59 AM Page vii

viii Preface

Conventions This Book UsesTake a minute to scan this section to learn some of the typographical and organiza-tional conventions that this book uses.

Excel commandsIn Excel, as in all Windows programs, you select commands from the pull-downmenu system. In this book, such commands appear in normal typeface. An optionavailable under a particular menu is indicated after an ➪ symbol, as in “ChooseFile ➪ Print to print your document.”

Filenames, named ranges, and your inputInput that you make from the keyboard appears in bold. Named ranges may appearin a code font. Lengthy input usually appears on a separate line. For instance, Imay instruct you to enter a formula such as the following:

=”Part Name: “ &VLOOKUP(PartNumber,PartList,2)

Key namesNames of the keys on your keyboard appear in normal type. When two keys should bepressed simultaneously, they are connected with a plus sign, like this: “Press Alt+E toselect the Edit menu.” Here are the key names as I refer to them throughout the book:

Alt down arrow Num Lock right arrow

Backspace End Pause Scroll Lock

Caps Lock Home PgDn Shift

Ctrl Insert PgUp Tab

Delete left arrow Print Screen up arrow

FunctionsExcel’s built-in worksheet functions appear in uppercase, like this: “Enter a SUM for-mula in cell C20.”

Mouse conventionsYou’ll come across some of the following mouse-related terms, all standard fare:

01 539671 FM.qxd 8/28/03 9:59 AM Page viii

ixPreface

✦ Mouse pointer: The small graphic figure that moves onscreen when you moveyour mouse. The mouse pointer is usually an arrow, but it changes shapewhen you move to certain areas of the screen or when you’re performing cer-tain actions.

✦ Point: Move the mouse so that the mouse pointer is on a specific item: forexample, “Point to the Save button on the toolbar.”

✦ Press: Press the left mouse button once and keep it pressed. Normally, this isused when dragging.

✦ Click: Press the left mouse button once and release it immediately.

✦ Right-click: Press the right mouse button once and release it immediately. Theright mouse button is used in Excel to pop up shortcut menus that are appro-priate for whatever is currently selected.

✦ Double-click: Press the left mouse button twice in rapid succession. If yourdouble-clicking doesn’t seem to be working, you can adjust the double-clicksensitivity by using the Windows Control Panel icon.

✦ Drag: Press the left mouse button and keep it pressed while you move themouse. Dragging is often used to select a range of cells or to change the sizeof an object.

What the Icons MeanThroughout the book, you’ll see special graphic symbols, or icons, in the left mar-gin. These call your attention to points that are particularly important or relevantto a specific group of readers. The icons in this book are as follows:

This icon signals the fact that something is important or worth noting. Notes mayalert you to a concept that helps you master the task at hand, or they may denotesomething that is fundamental to understanding subsequent material.

This icon marks a more efficient way of doing something that may not be obvious.

I use this symbol when a possibility exists that the operation we’re describingcould cause problems if you’re not careful.

This icon indicates that a related topic is discussed elsewhere in the book.Cross-Reference

Caution

Tip

Note

01 539671 FM.qxd 8/28/03 9:59 AM Page ix

x Preface

This icon indicates that a related example or file is available on the companionCD-ROM.

This icon indicates a feature that is new to Excel 2003.

How This Book Is OrganizedNotice that the book is divided into six main parts, followed by five appendixes.

Part I: Getting Started With Excel: This part consists of seven chapters that pro-vide background about Excel. These chapters are considered required reading forExcel newcomers, but even experienced users will probably find some new informa-tion here.

Part II: Working with Formulas and Functions: The chapters in Part II cover every-thing that you need to know to become proficient with performing calculations inExcel.

Part III: Creating Charts and Graphics: The chapters in Part III describe how tocreate effective charts as well as use graphics in your workbooks.

Part IV: Analyzing Data with Excel: Data analysis is the focus of the chapters inPart IV. Users of all levels will find some of these chapters of interest.

Part V: Using Advanced Excel Features: This part consists of nine chapters dealingwith topics that are sometimes considered advanced. However, many beginningand intermediate users may find this information useful as well.

Part VI: Programming Excel with VBA: Part VI is for those who want to customizeExcel for their own use or who are designing workbooks or add-ins that are to beused by others. It starts with an introduction to VBA programming and then pro-vides coverage of UserForms, add-ins, toolbars, menus, and events.

Part VII: Appendixes: Part VII contains a wide variety of appendixes that covereverything from Excel worksheet functions, to the contents of the book’s CD-ROM,to some fun games and diversions created using Excel.

How to Use This BookThis book is not intended to be read cover to cover. Rather, it’s a reference bookthat you can consult when:

✦ You’re stuck while trying to do something.

✦ You need to do something that you’ve never done before.

NewFeature

On theCD-ROM

01 539671 FM.qxd 8/28/03 9:59 AM Page x

xiPreface

✦ You have some time on your hands, and you’re interested in learning some-thing new.

The index is comprehensive, and each chapter typically focuses on a single broadtopic. If you’re just starting out with Excel, I recommend that you read the first fewchapters to gain a basic understanding of the product and then do some experi-menting on your own. After you become familiar with Excel’s environment, you canrefer to the chapters that interest you most. Some users, however, may prefer to follow the chapters in order.

Don’t be discouraged if some of the material is over your head. Most users get byjust fine by using only a small subset of Excel’s total capabilities. In fact, the 80/20rule applies here: 80 percent of Excel users use only 20 percent of its features.However, using only 20 percent of Excel’s features still gives you lots of power atyour fingertips.

New Features in Excel 2003This section briefly describes the new features in Excel 2003, relative to Excel 2002.Where applicable, I provide additional details later in this book. You’ll notice thatthe list is surprisingly short.

XML supportExcel 2003 has improved support for XML (eXtensible Markup Language). Thismeans that you can import XML data and assign the data elements to specific cellsin a worksheet.

List rangesYou can define a portion of a workbook as a list range. This may make it a bit easierto work with the list — for example, add new items and summary formulas. You canalso export the list range to SharePoint Team Services to share it with others. Thelist on a Web site based on SharePoint Team Services can be linked to the originalrange of cells.

Research PaneA new feature, Research Pane, lets you search standard reference books and Websites by using Excel’s Task Pane.

Smart tag improvementsIn the past, smart tags could either be turned on or off. It’s now possible to enablesmart tags only for a specified range of cells.

01 539671 FM.qxd 8/28/03 9:59 AM Page xi

xii Preface

Statistical functionsAdvanced users often complain about the inaccuracy of some of Excel’s statisticalfunctions. Microsoft claims to have corrected these long-standing problems.

What’s on the Companion CD and Web SiteWiley has provided so much add-on value to this book that we couldn’t fit it all onone CD! With the purchase of this book, you not only get access to over 200 bonussoftware programs and demos, but you also get an entire eBook — free!

Please take a few minutes to explore the bonus material included on the CD:

✦ Author-created materials: Demonstration and sample files from the book.

✦ Bonus software materials: Over 200 programs (shareware, freeware, GNUsoftware, trials, demos, and evaluation software) that work with Office. AReadMe file on the CD includes complete descriptions of each software item.

✦ Office 2003 Super Bible eBook: Wiley created this special eBook, consistingof over 500 pages of content about how Microsoft Office components worktogether and with other products. The content has been pulled from selectchapters of the individual Office Bible titles. In addition, some original contenthas been created just for this Super Bible.

✦ PDF version of this title: As always, if you prefer your text in electronic for-mat, the CD offers a completely searchable, PDF version of the book that youhold in your hands.

After you familiarize yourself with all that we have packed onto the CD, be sure tovisit the companion Web site at www.wiley.com/compbooks/officebibles2003/.Here’s what you’ll find on the Web site:

✦ Links to all the software that wouldn’t fit onto the CD

✦ Links to all the software found on the CD

✦ Complete, detailed tables of contents for all the Wiley Office 2003 Bibles:Access 2003 Bible, Excel 2003 Bible, FrontPage 2003 Bible, Office 2003 Bible,Outlook 2003 Bible, PowerPoint Bible, and Word 2003 Bible

✦ Links to other Wiley Office titles

01 539671 FM.qxd 8/28/03 9:59 AM Page xii

Contents at a GlancePreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

Part I: Getting Started with Excel . . . . . . . . . . . . . . . . . . . . . . 1Chapter 1: Introducing Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Chapter 2: Entering and Editing Worksheet Data . . . . . . . . . . . . . . . . . . . 25Chapter 3: Essential Worksheet Operations . . . . . . . . . . . . . . . . . . . . . . 43Chapter 4: Working with Cells and Ranges . . . . . . . . . . . . . . . . . . . . . . . 63Chapter 5: Worksheet Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85Chapter 6: Understanding Files and Templates . . . . . . . . . . . . . . . . . . . 105Chapter 7: Printing Your Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

Part II: Working with Formulas and Functions . . . . . . . . . . . . . 139Chapter 8: Introducing Formulas and Functions . . . . . . . . . . . . . . . . . . . 141Chapter 9: Creating Formulas That Manipulate Text . . . . . . . . . . . . . . . . 169Chapter 10: Working with Dates and Times . . . . . . . . . . . . . . . . . . . . . 189Chapter 11: Creating Formulas That Count and Sum . . . . . . . . . . . . . . . . 221Chapter 12: Creating Formulas That Look Up Values . . . . . . . . . . . . . . . . 249Chapter 13: Creating Formulas for Financial Applications . . . . . . . . . . . . . 269Chapter 14: Introducing Array Formulas . . . . . . . . . . . . . . . . . . . . . . . 295Chapter 15: Performing Magic with Array Formulas . . . . . . . . . . . . . . . . 317

Part III: Creating Charts and Graphics . . . . . . . . . . . . . . . . . . 337Chapter 16: Getting Started Making Charts . . . . . . . . . . . . . . . . . . . . . 339Chapter 17: Learning Advanced Charting . . . . . . . . . . . . . . . . . . . . . . 373Chapter 18: Enhancing Your Work with Pictures and Drawings . . . . . . . . . . 419

Part IV: Analyzing Data with Excel . . . . . . . . . . . . . . . . . . . . 435Chapter 19: Working with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437Chapter 20: Using External Database Files . . . . . . . . . . . . . . . . . . . . . . 463Chapter 21: Analyzing Data with Pivot Tables . . . . . . . . . . . . . . . . . . . . 479Chapter 22: Performing Spreadsheet What-If Analysis . . . . . . . . . . . . . . . 501Chapter 23: Analyzing Data Using Goal Seek and Solver . . . . . . . . . . . . . . 515Chapter 24: Analyzing Data with the Analysis ToolPak . . . . . . . . . . . . . . . 531

01 539671 FM.qxd 8/28/03 9:59 AM Page xiii

Part V: Using Advanced Excel Features . . . . . . . . . . . . . . . . . 543Chapter 25: Using Custom Number Formats . . . . . . . . . . . . . . . . . . . . . 545Chapter 26: Customizing Toolbars and Menus . . . . . . . . . . . . . . . . . . . . 563Chapter 27: Using Conditional Formatting and Data Validation . . . . . . . . . . 575Chapter 28: Creating and Using Worksheet Outlines . . . . . . . . . . . . . . . . 591Chapter 29: Linking and Consolidating Worksheets . . . . . . . . . . . . . . . . . 599Chapter 30: Excel and the Internet . . . . . . . . . . . . . . . . . . . . . . . . . . 613Chapter 31: Sharing Data with Other Applications . . . . . . . . . . . . . . . . . 623Chapter 32: Using Excel in a Workgroup . . . . . . . . . . . . . . . . . . . . . . . 639Chapter 33: Making Your Worksheets Error-Free . . . . . . . . . . . . . . . . . . 651

Part VI: Programming Excel with VBA . . . . . . . . . . . . . . . . . . 677Chapter 34: Introducing Visual Basic for Applications . . . . . . . . . . . . . . . 679Chapter 35: Creating Custom Worksheet Functions . . . . . . . . . . . . . . . . . 703Chapter 36: Creating UserForms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715Chapter 37: Using UserForm Controls in a Worksheet . . . . . . . . . . . . . . . 733Chapter 38: Working with Excel Events . . . . . . . . . . . . . . . . . . . . . . . . 745Chapter 39: VBA Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757Chapter 40: Creating Custom Excel Add-Ins . . . . . . . . . . . . . . . . . . . . . 773

Part VII: Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785Appendix A: Worksheet Function Reference . . . . . . . . . . . . . . . . . . . . . 787Appendix B: What’s on the CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . 803Appendix C: Just for Fun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815Appendix D: Additional Excel Resources . . . . . . . . . . . . . . . . . . . . . . . 837Appendix E: Excel Shortcut Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . 845

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853End-User License Agreement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899

01 539671 FM.qxd 8/28/03 9:59 AM Page xiv

ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

Part I: Getting Started with Excel 1

Chapter 1: Introducing Excel . . . . . . . . . . . . . . . . . . . . . . . . . 3What Is It Good For? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Understanding Workbooks and Worksheets . . . . . . . . . . . . . . . . . . . 4Moving Around a Worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Navigating with your keyboard . . . . . . . . . . . . . . . . . . . . . . . 7Navigating with your mouse . . . . . . . . . . . . . . . . . . . . . . . . . 8

Using the Excel Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . 9Using menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Using shortcut menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Using shortcut keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Using toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Working with Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Understanding dialog box controls . . . . . . . . . . . . . . . . . . . . 14Navigating dialog boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Using tabbed dialog boxes . . . . . . . . . . . . . . . . . . . . . . . . . 16

Creating Your First Excel Worksheet . . . . . . . . . . . . . . . . . . . . . . . 17Getting started on your worksheet . . . . . . . . . . . . . . . . . . . . 18Filling in the month names . . . . . . . . . . . . . . . . . . . . . . . . . 18Entering the sales data . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Summing the values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Making your worksheet look a bit fancier . . . . . . . . . . . . . . . . 20Creating a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Printing your worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . 22Saving your workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Chapter 2: Entering and Editing Worksheet Data . . . . . . . . . . . . 25Understanding the Types of Data You Can Use . . . . . . . . . . . . . . . . . 25

Understanding numerical values . . . . . . . . . . . . . . . . . . . . . 26Understanding text entries . . . . . . . . . . . . . . . . . . . . . . . . . 26Understanding formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Entering Text and Values into Your Worksheets . . . . . . . . . . . . . . . . 27Entering Dates and Times into Your Worksheets . . . . . . . . . . . . . . . . 28

Entering date values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Entering time values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

01 539671 FM.qxd 8/28/03 9:59 AM Page xv

xvi Contents

Modifying Cell Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Erasing the contents of a cell . . . . . . . . . . . . . . . . . . . . . . . 30Replacing the contents of a cell . . . . . . . . . . . . . . . . . . . . . . 30Editing the contents of a cell . . . . . . . . . . . . . . . . . . . . . . . . 31Learning some handy data-entry techniques . . . . . . . . . . . . . . 32

Applying Number Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Improving readability by formatting numbers . . . . . . . . . . . . . . 37Adding your own custom number formats . . . . . . . . . . . . . . . . 42

Chapter 3: Essential Worksheet Operations . . . . . . . . . . . . . . . 43Learning the Fundamentals of Excel Worksheets . . . . . . . . . . . . . . . 43

Working with Excel’s windows . . . . . . . . . . . . . . . . . . . . . . . 43Making a worksheet the active sheet . . . . . . . . . . . . . . . . . . . 46Adding a new worksheet to your workbook . . . . . . . . . . . . . . . 47Deleting a worksheet you no longer need . . . . . . . . . . . . . . . . 48Changing the name of a worksheet . . . . . . . . . . . . . . . . . . . . 48Changing a sheet tab’s color . . . . . . . . . . . . . . . . . . . . . . . . 49Rearranging your worksheets . . . . . . . . . . . . . . . . . . . . . . . 49Hiding and unhiding a worksheet . . . . . . . . . . . . . . . . . . . . . 51

Controlling the Worksheet View . . . . . . . . . . . . . . . . . . . . . . . . . 52Viewing a worksheet in multiple windows . . . . . . . . . . . . . . . . 52Comparing sheets side by side . . . . . . . . . . . . . . . . . . . . . . 53Splitting the worksheet window into panes . . . . . . . . . . . . . . . 54Keeping the titles in view by freezing panes . . . . . . . . . . . . . . . 54Zooming in or out for a better view . . . . . . . . . . . . . . . . . . . . 55Saving your view settings . . . . . . . . . . . . . . . . . . . . . . . . . . 57Monitoring cells with a Watch Window . . . . . . . . . . . . . . . . . . 58

Working with Rows and Columns . . . . . . . . . . . . . . . . . . . . . . . . 58Inserting rows and columns . . . . . . . . . . . . . . . . . . . . . . . . 59Deleting rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . 60Hiding rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . . 60Changing column widths and row heights . . . . . . . . . . . . . . . . 61

Chapter 4: Working with Cells and Ranges . . . . . . . . . . . . . . . . 63Understanding Cells and Ranges . . . . . . . . . . . . . . . . . . . . . . . . . 63

Selecting ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Selecting complete rows and columns . . . . . . . . . . . . . . . . . . 65Selecting noncontiguous ranges . . . . . . . . . . . . . . . . . . . . . . 65Selecting multisheet ranges . . . . . . . . . . . . . . . . . . . . . . . . 66Selecting special types of cells . . . . . . . . . . . . . . . . . . . . . . . 68

Copying or Moving Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Copying by using toolbar buttons . . . . . . . . . . . . . . . . . . . . . 72Copying by using menu commands . . . . . . . . . . . . . . . . . . . . 73Copying by using shortcut keys . . . . . . . . . . . . . . . . . . . . . . 73Copying by using drag-and-drop . . . . . . . . . . . . . . . . . . . . . . 73Copying to adjacent cells . . . . . . . . . . . . . . . . . . . . . . . . . . 74Copying a range to other sheets . . . . . . . . . . . . . . . . . . . . . . 75Using the Office Clipboard to paste . . . . . . . . . . . . . . . . . . . . 76Pasting in special ways . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

01 539671 FM.qxd 8/28/03 9:59 AM Page xvi

xviiContents

Using Names to Work with Ranges . . . . . . . . . . . . . . . . . . . . . . . . 79Creating range names in your workbooks . . . . . . . . . . . . . . . . 80Creating a table of range names . . . . . . . . . . . . . . . . . . . . . . 82Modifying existing range names . . . . . . . . . . . . . . . . . . . . . . 82

Adding Comments to Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

Chapter 5: Worksheet Formatting . . . . . . . . . . . . . . . . . . . . . 85Getting to Know the Formatting Tools . . . . . . . . . . . . . . . . . . . . . . 85

Using the Formatting toolbar . . . . . . . . . . . . . . . . . . . . . . . 86Using the Format Cells dialog box . . . . . . . . . . . . . . . . . . . . . 86

Using Formatting in Your Worksheets . . . . . . . . . . . . . . . . . . . . . . 87Using different fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Changing text alignment . . . . . . . . . . . . . . . . . . . . . . . . . . 90Using colors and shading . . . . . . . . . . . . . . . . . . . . . . . . . . 94Adding borders and lines . . . . . . . . . . . . . . . . . . . . . . . . . . 95Adding a background image to a worksheet . . . . . . . . . . . . . . . 96Using AutoFormat for quick and easy worksheet formatting . . . . . 97

Using Named Styles for Easier Formatting . . . . . . . . . . . . . . . . . . . 98Applying styles to your worksheets . . . . . . . . . . . . . . . . . . . 100Creating new styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101Modifying a style to meet your needs . . . . . . . . . . . . . . . . . . 102Merging styles from other workbooks . . . . . . . . . . . . . . . . . . 102Controlling styles with templates . . . . . . . . . . . . . . . . . . . . 103

Chapter 6: Understanding Files and Templates . . . . . . . . . . . . 105Understanding Excel Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

Creating a new workbook . . . . . . . . . . . . . . . . . . . . . . . . . 105Opening an existing workbook . . . . . . . . . . . . . . . . . . . . . . 107Saving and closing your workbooks . . . . . . . . . . . . . . . . . . . 110Using AutoRecover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Safeguarding your work . . . . . . . . . . . . . . . . . . . . . . . . . . 114

Understanding Excel Templates . . . . . . . . . . . . . . . . . . . . . . . . 115Working with the default templates . . . . . . . . . . . . . . . . . . . 116Creating custom templates . . . . . . . . . . . . . . . . . . . . . . . . 118

Chapter 7: Printing Your Work . . . . . . . . . . . . . . . . . . . . . . . 121Printing with One Click . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Adjusting Your Print Settings for Better Results . . . . . . . . . . . . . . . 122

Adjusting the settings in the Print dialog box . . . . . . . . . . . . . 122Adjusting the Page Setup settings . . . . . . . . . . . . . . . . . . . . 125Controlling where pages break in your printouts . . . . . . . . . . . 132Preventing certain cells from being printed . . . . . . . . . . . . . . 132

Using Print Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Viewing the print preview . . . . . . . . . . . . . . . . . . . . . . . . . 133Changing print settings while previewing . . . . . . . . . . . . . . . . 134Using Page Break Preview mode . . . . . . . . . . . . . . . . . . . . . 135Creating custom views of your worksheet . . . . . . . . . . . . . . . 137

01 539671 FM.qxd 8/28/03 9:59 AM Page xvii

xviii Contents

Part II: Working with Formulas and Functions 139

Chapter 8: Introducing Formulas and Functions . . . . . . . . . . . . 141Understanding Formula Basics . . . . . . . . . . . . . . . . . . . . . . . . . 141

Using operators in formulas . . . . . . . . . . . . . . . . . . . . . . . 142Understanding operator precedence in formulas . . . . . . . . . . . 143Using functions in your formulas . . . . . . . . . . . . . . . . . . . . . 145

Entering Formulas into Your Worksheets . . . . . . . . . . . . . . . . . . . 147Entering formulas manually . . . . . . . . . . . . . . . . . . . . . . . . 148Entering formulas by pointing . . . . . . . . . . . . . . . . . . . . . . 148Pasting range names into formulas . . . . . . . . . . . . . . . . . . . 148Inserting functions into formulas . . . . . . . . . . . . . . . . . . . . 149Function entry tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

Editing Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Using Cell References in Formulas . . . . . . . . . . . . . . . . . . . . . . . 152

Using relative, absolute, and mixed references . . . . . . . . . . . . . 152Changing the types of your references . . . . . . . . . . . . . . . . . 154Referencing cells outside the worksheet . . . . . . . . . . . . . . . . 155

Correcting Common Formula Errors . . . . . . . . . . . . . . . . . . . . . . 156Handling circular references . . . . . . . . . . . . . . . . . . . . . . . 157Changing when formulas are calculated . . . . . . . . . . . . . . . . . 159

Using Advanced Naming Techniques . . . . . . . . . . . . . . . . . . . . . . 160Using names for constants . . . . . . . . . . . . . . . . . . . . . . . . 161Using names for formulas . . . . . . . . . . . . . . . . . . . . . . . . . 161Using range intersections . . . . . . . . . . . . . . . . . . . . . . . . . 162Applying names to existing references . . . . . . . . . . . . . . . . . 164

Tips for Working with Formulas . . . . . . . . . . . . . . . . . . . . . . . . . 165Don’t hard-code values . . . . . . . . . . . . . . . . . . . . . . . . . . 165Using the formula bar as a calculator . . . . . . . . . . . . . . . . . . 165Making an exact copy of a formula . . . . . . . . . . . . . . . . . . . . 166Converting formulas to values . . . . . . . . . . . . . . . . . . . . . . 166

Chapter 9: Creating Formulas That Manipulate Text . . . . . . . . . 169A Few Words about Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

How many characters in a cell? . . . . . . . . . . . . . . . . . . . . . 169Numbers as text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Text Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171Determining whether a cell contains text . . . . . . . . . . . . . . . . 171Working with character codes . . . . . . . . . . . . . . . . . . . . . . 171Determining whether two strings are identical . . . . . . . . . . . . . 173Joining two or more cells . . . . . . . . . . . . . . . . . . . . . . . . . 173Displaying formatted values as text . . . . . . . . . . . . . . . . . . . 175Displaying formatted currency values as text . . . . . . . . . . . . . 176Repeating a character or string . . . . . . . . . . . . . . . . . . . . . 176Creating a text histogram . . . . . . . . . . . . . . . . . . . . . . . . . 177

01 539671 FM.qxd 8/28/03 9:59 AM Page xviii

xixContents

Padding a number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178Removing excess spaces and nonprinting characters . . . . . . . . . 179Counting characters in a string . . . . . . . . . . . . . . . . . . . . . . 179Changing the case of text . . . . . . . . . . . . . . . . . . . . . . . . . 179Extracting characters from a string . . . . . . . . . . . . . . . . . . . 180Replacing text with other text . . . . . . . . . . . . . . . . . . . . . . 181Finding and searching within a string . . . . . . . . . . . . . . . . . . 182Searching and replacing within a string . . . . . . . . . . . . . . . . . 182

Advanced Text Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Counting specific characters in a cell . . . . . . . . . . . . . . . . . . 183Counting the occurrences of a substring in a cell . . . . . . . . . . . 183Extracting a filename from a path specification . . . . . . . . . . . . 184Extracting the first word of a string . . . . . . . . . . . . . . . . . . . 184Extracting the last word of a string . . . . . . . . . . . . . . . . . . . 184Extracting all but the first word of a string . . . . . . . . . . . . . . . 185Extracting first names, middle names, and last names . . . . . . . . 185Removing titles from names . . . . . . . . . . . . . . . . . . . . . . . 187Counting the number of words in a cell . . . . . . . . . . . . . . . . . 187

Chapter 10: Working with Dates and Times . . . . . . . . . . . . . . . 189How Excel Handles Dates and Times . . . . . . . . . . . . . . . . . . . . . . 189

Understanding date serial numbers . . . . . . . . . . . . . . . . . . . 189Entering dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190Understanding time serial numbers . . . . . . . . . . . . . . . . . . . 192Entering times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Formatting dates and times . . . . . . . . . . . . . . . . . . . . . . . . 195Problems with dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

Date-Related Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198Displaying the current date . . . . . . . . . . . . . . . . . . . . . . . . 199Displaying any date . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199Generating a series of dates . . . . . . . . . . . . . . . . . . . . . . . 200Converting a non-date string to a date . . . . . . . . . . . . . . . . . 201Calculating the number of days between two dates . . . . . . . . . . 202Calculating the number of workdays between two dates . . . . . . . 203Offsetting a date using only workdays . . . . . . . . . . . . . . . . . . 204Calculating the number of years between two dates . . . . . . . . . 204Calculating a person’s age . . . . . . . . . . . . . . . . . . . . . . . . . 205Determining the day of the year . . . . . . . . . . . . . . . . . . . . . 206Determining the day of the week . . . . . . . . . . . . . . . . . . . . . 206Determining the date of the most recent Sunday . . . . . . . . . . . 207Determining the first day of the week after a date . . . . . . . . . . . 207Determining the nth occurrence of a day of the

week in a month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207Calculating dates of holidays . . . . . . . . . . . . . . . . . . . . . . . 208Determining the last day of a month . . . . . . . . . . . . . . . . . . . 210Determining whether a year is a leap year . . . . . . . . . . . . . . . 211Determining a date’s quarter . . . . . . . . . . . . . . . . . . . . . . . 211

01 539671 FM.qxd 8/28/03 9:59 AM Page xix

xx Contents

Time-Related Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211Displaying the current time . . . . . . . . . . . . . . . . . . . . . . . . 212Displaying any time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212Calculating the difference between two times . . . . . . . . . . . . . 213Summing times that exceed 24 hours . . . . . . . . . . . . . . . . . . 214Converting from military time . . . . . . . . . . . . . . . . . . . . . . 217Converting decimal hours, minutes, or seconds to a time . . . . . . 217Adding hours, minutes, or seconds to a time . . . . . . . . . . . . . . 218Rounding time values . . . . . . . . . . . . . . . . . . . . . . . . . . . 219Working with non-time-of-day values . . . . . . . . . . . . . . . . . . 219

Chapter 11: Creating Formulas That Count and Sum . . . . . . . . . 221Counting and Summing Worksheet Cells . . . . . . . . . . . . . . . . . . . . 221Basic Counting Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

Counting the total number of cells . . . . . . . . . . . . . . . . . . . . 224Counting blank cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225Counting nonblank cells . . . . . . . . . . . . . . . . . . . . . . . . . . 225Counting numeric cells . . . . . . . . . . . . . . . . . . . . . . . . . . 226Counting nontext cells . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Counting text cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Counting logical values . . . . . . . . . . . . . . . . . . . . . . . . . . 226Counting error values in a range . . . . . . . . . . . . . . . . . . . . . 226

Advanced Counting Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 227Counting cells by using the COUNTIF function . . . . . . . . . . . . . 227Counting cells by using multiple criteria . . . . . . . . . . . . . . . . 228Counting the most frequently occurring entry . . . . . . . . . . . . . 231Counting the occurrences of specific text . . . . . . . . . . . . . . . 232Counting the number of unique values . . . . . . . . . . . . . . . . . 234Creating a frequency distribution . . . . . . . . . . . . . . . . . . . . 235

Summing Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239Summing all cells in a range . . . . . . . . . . . . . . . . . . . . . . . 240Computing a cumulative sum . . . . . . . . . . . . . . . . . . . . . . . 241Summing the “top n” values . . . . . . . . . . . . . . . . . . . . . . . . 242

Conditional Sums Using a Single Criterion . . . . . . . . . . . . . . . . . . . 242Summing only negative values . . . . . . . . . . . . . . . . . . . . . . 243Summing values based on a different range . . . . . . . . . . . . . . 244Summing values based on a text comparison . . . . . . . . . . . . . 245Summing values based on a date comparison . . . . . . . . . . . . . 245

Conditional Sums Using Multiple Criteria . . . . . . . . . . . . . . . . . . . 245Using And criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246Using Or criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247Using And and Or criteria . . . . . . . . . . . . . . . . . . . . . . . . . 247

Chapter 12: Creating Formulas That Look Up Values . . . . . . . . . 249Introducing Lookup Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 249Functions Relevant to Lookups . . . . . . . . . . . . . . . . . . . . . . . . . 250

01 539671 FM.qxd 8/28/03 9:59 AM Page xx

xxiContents

Basic Lookup Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252The VLOOKUP function . . . . . . . . . . . . . . . . . . . . . . . . . . 252The HLOOKUP function . . . . . . . . . . . . . . . . . . . . . . . . . . 253The LOOKUP function . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Combining the MATCH and INDEX functions . . . . . . . . . . . . . . 255

Specialized Lookup Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 257Looking up an exact value . . . . . . . . . . . . . . . . . . . . . . . . . 257Looking up a value to the left . . . . . . . . . . . . . . . . . . . . . . . 258Performing a case-sensitive lookup . . . . . . . . . . . . . . . . . . . 260Choosing among multiple lookup tables . . . . . . . . . . . . . . . . 260Determining letter grades for test scores . . . . . . . . . . . . . . . . 261Calculating a grade-point average . . . . . . . . . . . . . . . . . . . . 262Performing a two-way lookup . . . . . . . . . . . . . . . . . . . . . . . 263Performing a two-column lookup . . . . . . . . . . . . . . . . . . . . 265Determining the cell address of a value within a range . . . . . . . . 266Looking up a value by using the closest match . . . . . . . . . . . . 267

Chapter 13: Creating Formulas for Financial Applications . . . . . . 269The Time Value of Money . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Loan Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

Worksheet functions for calculating loan information . . . . . . . . . 271A loan calculation example . . . . . . . . . . . . . . . . . . . . . . . . 274Credit card payments . . . . . . . . . . . . . . . . . . . . . . . . . . . 275Creating a loan amortization schedule . . . . . . . . . . . . . . . . . 277Summarizing loan options by using a data table . . . . . . . . . . . . 279Calculating a loan with irregular payments . . . . . . . . . . . . . . . 282

Investment Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Future value of a single deposit . . . . . . . . . . . . . . . . . . . . . 284Future value of a series of deposits . . . . . . . . . . . . . . . . . . . 288

Depreciation Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

Chapter 14: Introducing Array Formulas . . . . . . . . . . . . . . . . . 295Understanding Array Formulas . . . . . . . . . . . . . . . . . . . . . . . . . 295

A multicell array formula . . . . . . . . . . . . . . . . . . . . . . . . . 296A single-cell array formula . . . . . . . . . . . . . . . . . . . . . . . . 297Creating an array constant . . . . . . . . . . . . . . . . . . . . . . . . 298Array constant elements . . . . . . . . . . . . . . . . . . . . . . . . . 299

Understanding the Dimensions of an Array . . . . . . . . . . . . . . . . . . 299One-dimensional horizontal arrays . . . . . . . . . . . . . . . . . . . 300One-dimensional vertical arrays . . . . . . . . . . . . . . . . . . . . . 300Two-dimensional arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 301

Naming Array Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302Working with Array Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 303

Entering an array formula . . . . . . . . . . . . . . . . . . . . . . . . . 303Selecting an array formula range . . . . . . . . . . . . . . . . . . . . . 304

01 539671 FM.qxd 8/28/03 9:59 AM Page xxi

xxii Contents

Editing an array formula . . . . . . . . . . . . . . . . . . . . . . . . . . 304Expanding or contracting a multicell array formula . . . . . . . . . . 305

Using Multicell Array Formulas . . . . . . . . . . . . . . . . . . . . . . . . . 306Creating an array from values in a range . . . . . . . . . . . . . . . . 306Creating an array constant from values in a range . . . . . . . . . . . 306Performing operations on an array . . . . . . . . . . . . . . . . . . . 307Using functions with an array . . . . . . . . . . . . . . . . . . . . . . 308Transposing an array . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Generating an array of consecutive integers . . . . . . . . . . . . . . 309

Using Single-Cell Array Formulas . . . . . . . . . . . . . . . . . . . . . . . . 311Counting characters in a range . . . . . . . . . . . . . . . . . . . . . . 311Summing the three smallest values in a range . . . . . . . . . . . . . 312Counting text cells in a range . . . . . . . . . . . . . . . . . . . . . . . 313Eliminating intermediate formulas . . . . . . . . . . . . . . . . . . . . 314Using an array in lieu of a range reference . . . . . . . . . . . . . . . 315

Chapter 15: Performing Magic with Array Formulas . . . . . . . . . . 317Working with Single-Cell Array Formulas . . . . . . . . . . . . . . . . . . . 317

Summing a range that contains errors . . . . . . . . . . . . . . . . . . 318Counting the number of error values in a range . . . . . . . . . . . . 318Summing based on a condition . . . . . . . . . . . . . . . . . . . . . . 319Summing the n largest values in a range . . . . . . . . . . . . . . . . 320Computing an average that excludes zeros . . . . . . . . . . . . . . . 321Determining whether a particular value

appears in a range . . . . . . . . . . . . . . . . . . . . . . . . . . . 322Counting the number of differences in two ranges . . . . . . . . . . 323Returning the location of the maximum value

in a range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323Finding the row of a value’s nth occurrence

in a range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324Returning the longest text in a range . . . . . . . . . . . . . . . . . . 324Determining whether a range contains valid values . . . . . . . . . . 324Summing the digits of an integer . . . . . . . . . . . . . . . . . . . . . 325Summing rounded values . . . . . . . . . . . . . . . . . . . . . . . . . 326Summing every nth value in a range . . . . . . . . . . . . . . . . . . . 327Removing non-numeric characters from a string . . . . . . . . . . . 329Determining the closest value in a range . . . . . . . . . . . . . . . . 329Returning the last value in a column . . . . . . . . . . . . . . . . . . . 330Returning the last value in a row . . . . . . . . . . . . . . . . . . . . . 331Ranking data with an array formula . . . . . . . . . . . . . . . . . . . 331

Working with Multicell Array Formulas . . . . . . . . . . . . . . . . . . . . 332Returning only positive values from a range . . . . . . . . . . . . . . 332Returning nonblank cells from a range . . . . . . . . . . . . . . . . . 333Returning a list of unique items in a range . . . . . . . . . . . . . . . 334Displaying a calendar in a range . . . . . . . . . . . . . . . . . . . . . 334

01 539671 FM.qxd 8/28/03 9:59 AM Page xxii

xxiiiContents

Part III: Creating Charts and Graphics 337

Chapter 16: Getting Started Making Charts . . . . . . . . . . . . . . . 339What Is a Chart? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339How Excel Handles Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

Embedded charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Chart sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

Parts of a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342Creating Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

Creating a chart with one keystroke . . . . . . . . . . . . . . . . . . . 344Creating a chart with a mouse click . . . . . . . . . . . . . . . . . . . 345Using the Chart Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 346

Hands On: Creating a Chart with the Chart Wizard . . . . . . . . . . . . . . 348Selecting the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348Chart Wizard — Step 1 of 4 . . . . . . . . . . . . . . . . . . . . . . . . 349Chart Wizard — Step 2 of 4 . . . . . . . . . . . . . . . . . . . . . . . . 350Chart Wizard — Step 3 of 4 . . . . . . . . . . . . . . . . . . . . . . . . 353Chart Wizard — Step 4 of 4 . . . . . . . . . . . . . . . . . . . . . . . . 354

Basic Chart Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355Moving and resizing a chart . . . . . . . . . . . . . . . . . . . . . . . 356Changing the chart type . . . . . . . . . . . . . . . . . . . . . . . . . . 356Copying a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356Deleting a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357Moving and deleting chart elements . . . . . . . . . . . . . . . . . . . 357Other modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

Printing Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357Understanding Chart Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 359

Choosing a chart type . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Standard chart types . . . . . . . . . . . . . . . . . . . . . . . . . . . 361Column charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361Bar charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Line charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Pie charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364XY (scatter) charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366Area charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366Doughnut charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367Radar charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368Surface charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Bubble charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Stock charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370Cylinder, cone, and pyramid charts . . . . . . . . . . . . . . . . . . . 371

01 539671 FM.qxd 8/28/03 9:59 AM Page xxiii

xxiv Contents

Chapter 17: Learning Advanced Charting . . . . . . . . . . . . . . . . 373Understanding Chart Customization . . . . . . . . . . . . . . . . . . . . . . 373Changing Basic Chart Elements . . . . . . . . . . . . . . . . . . . . . . . . . 374

Selecting chart elements . . . . . . . . . . . . . . . . . . . . . . . . . 374Modifying properties by using the Format dialog box . . . . . . . . . 376Modifying the Chart Area . . . . . . . . . . . . . . . . . . . . . . . . . 377Modifying the Plot Area . . . . . . . . . . . . . . . . . . . . . . . . . . 377Working with chart titles . . . . . . . . . . . . . . . . . . . . . . . . . 378Working with the legend . . . . . . . . . . . . . . . . . . . . . . . . . . 379Changing the chart gridlines . . . . . . . . . . . . . . . . . . . . . . . 381Modifying the axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382

Working with Data Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Deleting a data series . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Adding a new data series to a chart . . . . . . . . . . . . . . . . . . . 386Changing data used by a series . . . . . . . . . . . . . . . . . . . . . . 387Displaying data labels in a chart . . . . . . . . . . . . . . . . . . . . . 389Handling missing data . . . . . . . . . . . . . . . . . . . . . . . . . . . 390Controlling a data series by hiding data . . . . . . . . . . . . . . . . . 390Adding error bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391Adding a trend line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392Modifying 3-D charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392Formatting a surface chart . . . . . . . . . . . . . . . . . . . . . . . . 393Creating combination charts . . . . . . . . . . . . . . . . . . . . . . . 394Using secondary axes . . . . . . . . . . . . . . . . . . . . . . . . . . . 395Displaying a data table . . . . . . . . . . . . . . . . . . . . . . . . . . 395

Creating Custom Chart Types . . . . . . . . . . . . . . . . . . . . . . . . . . 396About custom chart types . . . . . . . . . . . . . . . . . . . . . . . . 396Creating your own custom chart types . . . . . . . . . . . . . . . . . 396

Learning Some Chart-Making Tricks . . . . . . . . . . . . . . . . . . . . . . 398Creating picture charts . . . . . . . . . . . . . . . . . . . . . . . . . . 398Creating a thermometer chart . . . . . . . . . . . . . . . . . . . . . . 399Creating a gauge chart . . . . . . . . . . . . . . . . . . . . . . . . . . . 400Creating a comparative histogram . . . . . . . . . . . . . . . . . . . . 401Creating a Gantt chart . . . . . . . . . . . . . . . . . . . . . . . . . . . 402Creating a chart that updates automatically . . . . . . . . . . . . . . 403Plotting mathematical functions with one variable . . . . . . . . . . 404Plotting mathematical functions with two variables . . . . . . . . . . 405

Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . 406Questions about chart settings . . . . . . . . . . . . . . . . . . . . . . 406Chart formatting questions . . . . . . . . . . . . . . . . . . . . . . . . 408Chart series questions . . . . . . . . . . . . . . . . . . . . . . . . . . . 412Chart type questions . . . . . . . . . . . . . . . . . . . . . . . . . . . 414Miscellaneous chart questions . . . . . . . . . . . . . . . . . . . . . . 415

Chapter 18: Enhancing Your Work with Pictures and Drawings . . . 419Using AutoShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

The AutoShapes toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . 419Inserting AutoShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . 420

01 539671 FM.qxd 8/28/03 9:59 AM Page xxiv

xxvContents

Adding text to an AutoShape . . . . . . . . . . . . . . . . . . . . . . . 422Formatting AutoShape objects . . . . . . . . . . . . . . . . . . . . . . 423Selecting multiple objects . . . . . . . . . . . . . . . . . . . . . . . . . 423Moving objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423Copying objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Rotating AutoShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Modifying AutoShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Changing the stack order of objects . . . . . . . . . . . . . . . . . . . 424Grouping objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424

Using the Drawing Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . 425Aligning objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425Spacing objects evenly . . . . . . . . . . . . . . . . . . . . . . . . . . 426Changing an AutoShape to a different AutoShape . . . . . . . . . . . 426Adding shadows and 3-D effects . . . . . . . . . . . . . . . . . . . . . 426Changing the AutoShape defaults . . . . . . . . . . . . . . . . . . . . 427Printing objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427

Working with Other Graphic Types . . . . . . . . . . . . . . . . . . . . . . . 428About graphics files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428Using the Microsoft Clip Organizer . . . . . . . . . . . . . . . . . . . 428Inserting graphics files . . . . . . . . . . . . . . . . . . . . . . . . . . 430Copying graphics by using the Clipboard . . . . . . . . . . . . . . . . 430Importing from a digital camera or scanner . . . . . . . . . . . . . . 430Displaying a worksheet background image . . . . . . . . . . . . . . . 431Modifying pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431

Using the Office Applets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432Creating diagrams and org charts . . . . . . . . . . . . . . . . . . . . 432Creating WordArt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434

Part IV: Analyzing Data with Excel 435

Chapter 19: Working with Lists . . . . . . . . . . . . . . . . . . . . . . 437What Is a List? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437What Can You Do with a List? . . . . . . . . . . . . . . . . . . . . . . . . . . 438Designing a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439Entering Data into a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439

Entering data with the Data Form dialog box . . . . . . . . . . . . . . 441Other uses for the Data Form dialog box . . . . . . . . . . . . . . . . 441

Filtering a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442Using autofiltering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442Using advanced filtering . . . . . . . . . . . . . . . . . . . . . . . . . . 446

Using Database Functions with Lists . . . . . . . . . . . . . . . . . . . . . . 452Sorting a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454

Simple sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454More-complex sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . 455Using a custom sort order . . . . . . . . . . . . . . . . . . . . . . . . 456Sorting nonlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

Creating Subtotals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

01 539671 FM.qxd 8/28/03 9:59 AM Page xxv

xxvi Contents

Working with a Designated List . . . . . . . . . . . . . . . . . . . . . . . . . 460Creating a designated list . . . . . . . . . . . . . . . . . . . . . . . . . 460Adding rows or columns to a designated list . . . . . . . . . . . . . 461Adding summary formulas to a designated list . . . . . . . . . . . . 462Advantage in using a designated list . . . . . . . . . . . . . . . . . . . 462

Chapter 20: Using External Database Files . . . . . . . . . . . . . . . 463Understanding External Database Files . . . . . . . . . . . . . . . . . . . . 463Retrieving Data with Query: An Example . . . . . . . . . . . . . . . . . . . 465

The database file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465The task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466Using Query to get the data . . . . . . . . . . . . . . . . . . . . . . . . 466

Working with Data Returned by Query . . . . . . . . . . . . . . . . . . . . . 472Adjusting the external data range properties . . . . . . . . . . . . . . 472Refreshing a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473Deleting a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474Changing your query . . . . . . . . . . . . . . . . . . . . . . . . . . . 474

Using Query without the Wizard . . . . . . . . . . . . . . . . . . . . . . . . 474Creating a query manually . . . . . . . . . . . . . . . . . . . . . . . . 475Using multiple database tables . . . . . . . . . . . . . . . . . . . . . . 476Adding and editing records in external database tables . . . . . . . 477Formatting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477Learning more about Query . . . . . . . . . . . . . . . . . . . . . . . 477

Chapter 21: Analyzing Data with Pivot Tables . . . . . . . . . . . . . 479About Pivot Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479

A pivot table example . . . . . . . . . . . . . . . . . . . . . . . . . . . 480Data appropriate for a pivot table . . . . . . . . . . . . . . . . . . . . 482

Creating a Pivot Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484Step1: Specifying the data location . . . . . . . . . . . . . . . . . . . 484Step 2: Specifying the data . . . . . . . . . . . . . . . . . . . . . . . . 485Step 3: Completing the pivot table . . . . . . . . . . . . . . . . . . . . 486

Grouping Pivot Table Items . . . . . . . . . . . . . . . . . . . . . . . . . . . 492Creating a Calculated Field or Calculated Item . . . . . . . . . . . . . . . . 495

Creating a calculated field in a pivot table . . . . . . . . . . . . . . . 496Inserting a calculated item into a pivot table . . . . . . . . . . . . . . 497

Chapter 22: Performing Spreadsheet What-If Analysis . . . . . . . . 501A What-If Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501Types of What-If Analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503Manual What-If Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503Creating Data Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503

Creating a one-input data table . . . . . . . . . . . . . . . . . . . . . . 504Creating a two-input data table . . . . . . . . . . . . . . . . . . . . . . 506

01 539671 FM.qxd 8/28/03 9:59 AM Page xxvi

xxviiContents

Using Scenario Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509Defining scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509Displaying scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512Modifying scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513Merging scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513Generating a scenario report . . . . . . . . . . . . . . . . . . . . . . . 513

Chapter 23: Analyzing Data Using Goal Seek and Solver . . . . . . . 515What-If Analysis — in Reverse . . . . . . . . . . . . . . . . . . . . . . . . . . 515Single-Cell Goal Seeking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516

A goal-seeking example . . . . . . . . . . . . . . . . . . . . . . . . . . 516More about goal seeking . . . . . . . . . . . . . . . . . . . . . . . . . 517

Introducing Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518Appropriate problems for Solver . . . . . . . . . . . . . . . . . . . . . 518A simple Solver example . . . . . . . . . . . . . . . . . . . . . . . . . 519More about Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523

Solver Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524Minimizing shipping costs . . . . . . . . . . . . . . . . . . . . . . . . 524Allocating resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527Optimizing an investment portfolio . . . . . . . . . . . . . . . . . . . 528

Chapter 24: Analyzing Data with the Analysis ToolPak . . . . . . . . 531The Analysis ToolPak: An Overview . . . . . . . . . . . . . . . . . . . . . . 531Using the Analysis ToolPak . . . . . . . . . . . . . . . . . . . . . . . . . . . 532

Installing the Analysis ToolPak add-in . . . . . . . . . . . . . . . . . . 532Using the Analysis tools . . . . . . . . . . . . . . . . . . . . . . . . . . 533Using the Analysis ToolPak functions . . . . . . . . . . . . . . . . . . 533

The Analysis ToolPak Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 534The Analysis of Variance tool . . . . . . . . . . . . . . . . . . . . . . . 534The Correlation tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535The Covariance tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536The Descriptive Statistics tool . . . . . . . . . . . . . . . . . . . . . . 536The Exponential Smoothing tool . . . . . . . . . . . . . . . . . . . . . 536The F-Test (Two-Sample Test for Variance) tool . . . . . . . . . . . . 537The Fourier Analysis tool . . . . . . . . . . . . . . . . . . . . . . . . . 537The Histogram tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537The Moving Average tool . . . . . . . . . . . . . . . . . . . . . . . . . 538The Random Number Generation tool . . . . . . . . . . . . . . . . . . 538The Rank and Percentile tool . . . . . . . . . . . . . . . . . . . . . . . 540The Regression tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540The Sampling tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541The t-Test tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542The z-Test (Two-Sample Test for Means) tool . . . . . . . . . . . . . 542

01 539671 FM.qxd 8/28/03 9:59 AM Page xxvii

xxviii Contents

Part V: Using Advanced Excel Features 543

Chapter 25: Using Custom Number Formats . . . . . . . . . . . . . . 545About Number Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545

Automatic number formatting . . . . . . . . . . . . . . . . . . . . . . 545Formatting numbers by using toolbar buttons . . . . . . . . . . . . . 546Using shortcut keys to format numbers . . . . . . . . . . . . . . . . . 547Using the format cells dialog box to format numbers . . . . . . . . . 547

Creating a Custom Number Format . . . . . . . . . . . . . . . . . . . . . . . 548About custom number formats . . . . . . . . . . . . . . . . . . . . . . 549Parts of a number format string . . . . . . . . . . . . . . . . . . . . . 550Custom number format codes . . . . . . . . . . . . . . . . . . . . . . 551

Custom Number Format Examples . . . . . . . . . . . . . . . . . . . . . . . 553Scaling values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553Displaying leading zeros . . . . . . . . . . . . . . . . . . . . . . . . . . 557Displaying fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557Displaying a negative sign on the right . . . . . . . . . . . . . . . . . 558Formatting dates and times . . . . . . . . . . . . . . . . . . . . . . . . 559Displaying text with numbers . . . . . . . . . . . . . . . . . . . . . . . 559Suppressing certain types of entries . . . . . . . . . . . . . . . . . . . 560Filling a cell with a repeating character . . . . . . . . . . . . . . . . . 561

Chapter 26: Customizing Toolbars and Menus . . . . . . . . . . . . . 563Customizing Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563

Types of customizations . . . . . . . . . . . . . . . . . . . . . . . . . 564Shortcut menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565

Moving Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565Using the Customize Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . 565

The Toolbars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565The Commands tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568The Options tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568

Adding or Removing Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . 569Moving and copying buttons . . . . . . . . . . . . . . . . . . . . . . . 570Inserting a new button . . . . . . . . . . . . . . . . . . . . . . . . . . . 570

Other Toolbar Button Operations . . . . . . . . . . . . . . . . . . . . . . . 570Changing a Toolbar Button’s Image . . . . . . . . . . . . . . . . . . . . . . . 572

Using a built-in image . . . . . . . . . . . . . . . . . . . . . . . . . . . 572Editing a button image . . . . . . . . . . . . . . . . . . . . . . . . . . . 572Copying another button image . . . . . . . . . . . . . . . . . . . . . . 573

Chapter 27: Using Conditional Formatting and Data Validation . . . 575Conditional Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575

Specifying conditional formatting . . . . . . . . . . . . . . . . . . . . 576Formatting types you can apply . . . . . . . . . . . . . . . . . . . . . 576Specifying conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 577Working with conditional formats . . . . . . . . . . . . . . . . . . . . 579Conditional formatting formula examples . . . . . . . . . . . . . . . 582

01 539671 FM.qxd 8/28/03 9:59 AM Page xxviii