John Walkenbach Simplify number crunching and analysis Create boardroom quality charts and diagrams Analyze mounds of data with pivot tables Walkenbach The book you need to succeed! The perennial bestseller—now fully updated for Excel 2007! Whether you’re already a power user or just starting, find out how to get the most out of this major new release of Excel from expert instructor and Microsoft MVP, “Mr. Spreadsheet,” John Walkenbach. Each of the book’s seven parts thoroughly focuses on key elements, so no matter what your level of expertise, you’ll find what you need in the hundreds of examples, techniques, and tips in this comprehensive resource. • Master Excel’s new “menu-less” Ribbon user interface • Understand formulas, functions, tables, worksheets, and workbooks • Explore the new unlimited conditional formatting • Develop custom functions, program with VBA, and create UserForms • Analyze data using external database files and pivot tables • Enhance your worksheets with new SmartArt tools • Customize the Quick Access Toolbar and save time CD-ROM Included! • All examples and workbooks from the book • Searchable PDF of the book Value-Packed CD-ROM “ John Walkenbach provides excellent examples in this book…that Excel users will find very useful.” — David McRitchie, Microsoft MVP Meet John Walkenbach John Walkenbach, a.k.a “Mr. Spreadsheet,” is a principal of J-Walk and Associates, Inc. and a Microsoft Excel MVP. He is a leading authority on spreadsheet software and creator of the award- winning Power Utility Pak. He has written more than 50 books, including Excel 2003 Formulas and Excel 2003 Power Programming with VBA, as well as articles and reviews for publications including PC World, InfoWorld, and Windows. He also maintains the popular Spreadsheet Page at www.j-walk.com/ss. Shelving Category: COMPUTERS/Spreadsheets Reader Level: Beginning to Advanced $39.99 USA $47.99 Canada £25.99 UK ISBN 0-470-04403-9 Easily create summary reports of your data with the enhanced PivotTable tool The new Page Layout View displays your worksheet exactly as it will be printed System Requirements: Please see the CD-ROM appendix for details and complete system requirements. ® Excel 2007 Microsoft® Offi ce ® Microsoft ® Offi ce Excel ® 2007 Bible 01_044039 ffirs.qxp 11/21/06 10:53 AM Page i 01_044039 ffirs.qxp 11/21/06 10:53 AM Page ii Excel ® 2007 Bible John Walkenbach 01_044039 ffirs.qxp 11/21/06 10:53 AM Page iii Excel ® 2007 Bible Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada Library of Congress Control Number: 2006934841 ISBN-13: 978-0-470-04403-2 ISBN-10: 0-470-04403-9 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 1B/QY/RS/QW/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 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. 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. Microsoft and Excel are registered trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. 01_044039 ffirs.qxp 11/21/06 10:53 AM Page iv About the Author John Walkenbach is a bestselling Excel author and has published more than 50 spreadsheet books. He lives amid the saguaros, javelinas, and gila monsters in Southern Arizona. For more information, Google him. 01_044039 ffirs.qxp 11/21/06 10:53 AM Page v Credits Acquisitions Manager Gregory S. Croy Project Editor Kelly Ewing Technical Editor Doug Sahlin Editorial Manager Jodi Jensen Vice President & Executive Group Publisher Richard Swadley Vice President and Publisher Andy Cummings Editorial Director Mary C. Corder Project Coordinator Erin Smith Graphics and Production Specialists Beth Brooks Carrie A. Foster Joyce Haughey Jennifer Mayberry Barbara Moore Lynsey Osborn Heather Pope Ronald Terry Quality Control Technicians Laura Albert Jessica Kramer Christine Pingleton Brian H. Walls Media Development Project Supervisor Laura Moss Media Development Specialist Steve Kudirka Proofreading and Indexing Techbooks This one’s for Pamn, who pretty much left me alone while I was writing it. 01_044039 ffirs.qxp 11/21/06 10:53 AM Page vi Acknowledgments xxxiii Introduction xxxix Part I: Getting Started with Excel . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 1: Introducing Excel 3 Chapter 2: What’s New in Excel 2007? 25 Chapter 3: Entering and Editing Worksheet Data 35 Chapter 4: Essential Worksheet Operations 53 Chapter 5: Working with Cells and Ranges 71 Chapter 6: Introducing Tables 95 Chapter 7: Worksheet Formatting 109 Chapter 8: Understanding Excel’s Files 131 Chapter 9: Using and Creating Templates 145 Chapter 10: Printing Your Work 155 Part II: Working with Formulas and Functions . . . . . . . . . . . . . 173 Chapter 11: Introducing Formulas and Functions 175 Chapter 12: Creating Formulas That Manipulate Text 205 Chapter 13: Working with Dates and Times 223 Chapter 14: Creating Formulas That Count and Sum 249 Chapter 15: Creating Formulas That Look Up Values 273 Chapter 16: Creating Formulas for Financial Applications 291 Chapter 17: Introducing Array Formulas 313 Chapter 18: Performing Magic with Array Formulas 333 Part III: Creating Charts and Graphics . . . . . . . . . . . . . . . . . . . 349 Chapter 19: Getting Started Making Charts 351 Chapter 20: Learning Advanced Charting 381 Chapter 21: Visualizing Data Using Conditional Formatting 421 Chapter 22: Enhancing Your Work with Pictures and Drawings 441 Part IV: Using Advanced Excel Features . . . . . . . . . . . . . . . . . . 459 Chapter 23: Customizing the Quick Access Toolbar 461 Chapter 24: Using Custom Number Formats 465 Chapter 25: Using Data Validation 481 Chapter 26: Creating and Using Worksheet Outlines 491 Chapter 27: Linking and Consolidating Worksheets 499 Chapter 28: Excel and the Internet 513 Chapter 29: Sharing Data with Other Applications 521 vii 02_044039 ftoc.qxp 11/21/06 10:53 AM Page vii Chapter 30: Using Excel in a Workgroup 531 Chapter 31: Protecting Your Work 539 Chapter 32: Making Your Worksheets Error-Free 551 Part V: Analyzing Data with Excel. . . . . . . . . . . . . . . . . . . . . . . 573 Chapter 33: Using Microsoft Query with External Database Files 575 Chapter 34: Introducing Pivot Tables 591 Chapter 35: Analyzing Data with Pivot Tables 609 Chapter 36: Performing Spreadsheet What-If Analysis 635 Chapter 37: Analyzing Data Using Goal Seek and Solver 649 Chapter 38: Analyzing Data with the Analysis ToolPak 667 Part VI: Programming Excel with VBA. . . . . . . . . . . . . . . . . . . . 679 Chapter 39: Introducing Visual Basic for Applications 681 Chapter 40: Creating Custom Worksheet Functions 703 Chapter 41: Creating UserForms 715 Chapter 42: Using UserForm Controls in a Worksheet 733 Chapter 43: Working with Excel Events 745 Chapter 44: VBA Examples 757 Chapter 45: Creating Custom Excel Add-Ins 771 Part VII: Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783 Appendix A: Worksheet Function Reference 785 Appendix B: What’s on the CD-ROM 799 Appendix C: Additional Excel Resources 809 Appendix D: Excel Shortcut Keys 815 Index 823 Wiley Publishing, Inc. End-User License Agreement 869 viii Contents at a Glance 02_044039 ftoc.qxp 11/21/06 10:53 AM Page viii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxix Part I: Getting Started with Excel 1 Chapter 1: Introducing Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 What Is Excel Good For? 3 Understanding Workbooks and Worksheets 4 Moving Around a Worksheet 6 Navigating with your keyboard 6 Navigating with your mouse 7 Introducing the Ribbon 7 Ribbon tabs 8 Contextual tabs 9 Types of commands on the Ribbon 10 Accessing the Ribbon using your keyboard 11 Using the shortcut menus 13 Customizing your Quick Access Toolbar 14 Working with Dialog Boxes 15 Navigating dialog boxes 16 Using tabbed dialog boxes 16 Using the Taskbar 17 Creating Your First Excel Worksheet 18 Getting started on your worksheet 18 Filling in the month names 19 Entering the sales data 19 Formatting the numbers 20 Making your worksheet look a bit fancier 20 Summing the values 21 Creating a chart 21 Printing your worksheet 22 Saving your workbook 23 Chapter 2: What’s New in Excel 2007?. . . . . . . . . . . . . . . . . . . . . 25 A New User Interface 25 Larger Worksheets 26 New File Formats 27 Worksheet Tables 27 Styles and Themes 28 ix 02_044039 ftoc.qxp 11/21/06 10:53 AM Page ix [...]... Additional Excel Resources 809 Appendix D: Excel Shortcut Keys 815 Index 823 Wiley Publishing, Inc End-User License Agreement 869 xxxii W riting Excel 2007 Bible was one of my most challenging projects Never before has an Excel upgrade incorporated so many new features and changes Thanks to the brilliant people at Microsoft. .. 140 Closing workbooks 141 Safeguarding your work 141 Excel File Compatibility 142 Recognizing the Excel 2007 file formats 142 Saving a file for use with an older version of Excel 143 Chapter 9: Using and Creating Templates 145 Exploring Excel Templates 145 Viewing templates 145 Creating a workbook... use this same acknowledgment when I write the Excel 2010 Bible I don’t really want to, but legal pressure forces me to acknowledge the contributions of Toad, whose life I saved during the war — and then lived to regret it I also thank Mrs Toad, not because she actually did anything, but because it’s very unlikely that she will be mentioned in any other Excel 2007 books, and she might buy a copy if she... for Power Utility Pak and apologize to me via e-mail Thanks to Ruth Maher in Ireland, who figured out the secret to using Excel She always takes her Excel with a full pint of Guinness I must also thank Soren Bo Christensen from Denmark, for being the only Dane interested in Excel 2007 (or so he claims) But most of all, I thank Gareth Forster in England, for being over there and not here And least but... Workbook in a Word Document 527 Embedding a workbook in Word by copying 528 Embedding a saved workbook in Word 529 Creating a new Excel object in Word 529 Chapter 30: Using Excel in a Workgroup 531 Using Excel on a Network 531 Understanding File Reservations 532 Sharing Workbooks 533 Understanding shared workbooks... quality of education in our great country I’d also like to thank the always deft Biff, for answering thousands of Excel questions in the Microsoft newsgroups so I could spend my time writing this book And thanks to Brent Nichols, who took the time to explain to me the difference between Excel and axles Now, looking under my car isn’t so perplexing Thanks, Mr Ed, for siring the love of my life I’m down... thankable, and Mikey McGrinder for being Guitarded But most of all, I’m grateful to cyberhobo for his respectful silence I would also like to acknowledge Granny Dee When she purchases her copy of the Excel 2007 Bible, it’s very likely that she will own more copies than the Vatican Library This book wouldn’t be the book it is if it weren’t for danielo, whose favorite answer is usually found in cell G16 Thanks... Using Excel s Auditing Tools 560 Identifying cells of a particular type 560 Viewing formulas 562 Tracing cell relationships 562 Identifying precedents 563 Identifying dependents 564 Tracing error values 564 Fixing circular reference errors 564 Using background error-checking feature 564 Using Excel Formula... Replacing information 568 Searching for formatting 568 Spell Checking Your Worksheets 569 Using AutoCorrect 570 Part V: Analyzing Data with Excel 573 Chapter 33: Using Microsoft Query with External Database Files 575 Understanding External Database Files 575 Importing Access Tables 576 xxvi Contents Retrieving Data with Query:... Format Cells dialog box 49 Adding your own custom number formats 51 x Contents Chapter 4: Essential Worksheet Operations 53 Learning the Fundamentals of Excel Worksheets 53 Working with Excel s windows 53 Moving and resizing windows 55 Switching among windows 55 Closing windows 56 Activating a worksheet 56 Adding . requirements. ® Excel 2007 Microsoft Offi ce ® Microsoft ® Offi ce Excel ® 2007 Bible 01_044039 ffirs.qxp 11/21/06 10:53 AM Page i 01_044039 ffirs.qxp 11/21/06 10:53 AM Page ii Excel ® 2007 Bible John. fully updated for Excel 2007! Whether you’re already a power user or just starting, find out how to get the most out of this major new release of Excel from expert instructor and Microsoft MVP,. ffirs.qxp 11/21/06 10:53 AM Page iii Excel ® 2007 Bible Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2007 by Wiley Publishing, Inc.,