Excel Formulas and Functions FOR DUMmIES by Ken Bluttman and Peter G. Aitken
Excel Formulas and Functions FOR DUMmIES
Excel Formulas and Functions FOR DUMmIES by Ken Bluttman and Peter G. Aitken
Excel Formulas and Functions For Dummies Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 Copyright 2005 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without 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, e-mail: brandreview@wiley.com. Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, 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 other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP- RESENTATIONS 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 CRE- ATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CON- TAINED 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 FUR- THER 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, 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. For technical support, please visit www.wiley.com/techsupport. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2004107915 ISBN: 0-7645-7556-2 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 1O/QU/QR/QV/IN
About the Authors Ken Bluttman has been working as a software developer for 15 years. Ken specializes in VB/VBA based applications, often with an emphasis on Microsoft Office. Ken has written several articles on various computer topics including Office/VBA development, XML, SQL Server, and InfoPath. His most recent book is Developing Microsoft Office Solutions. Ken lives in New York with his wife, son, and dog. Peter Aitken has been writing about computers and programming for over 10 years, with over 35 books well as hundreds of magazine and trade publication articles to his credit. His recent book titles include Powering Office 2003 With XML, Excel Programming Weekend Crash Course,.NET Graphics and Printing, Visual Basic.NET Programming With Peter Aitken, Office XP Development With VBA, XML the Microsoft Way, Windows Script Host, and Teach Yourself Visual Basic.NET Internet Programming in 21 Days.
Authors Acknowledgments Much activity goes on behind the scenes in bringing a book from idea to reality. Many people are involved. We wish to thank the great Wiley staff Jade Williams, Tom Heine, Elizabeth Kuball, Kerwin McKenzie, and everyone on the Production team for all their hard work! Peter G. Aitken and Ken Bluttman Thanks to co-author Peter Aitken for his contributions, insights, and suggestions. Special thanks to my family for understanding that at times sitting in front of a computer is a priority, even when it means I have to miss something special. Ken Bluttman
Dedication Dedicated to all the ones I love. A special appreciation for Matthew. You keep the shine in my eyes. Gayla, I am very happy we made it through a rough summer. Ken Bluttman
Publisher s Acknowledgments We re proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Media Development Project Editor: Jade L. Williams Acquisitions Editor: Tom Heine Copy Editor: Elizabeth Kuball Technical Editor: Kerwin McKenzie Editorial Manager: Robyn Siesky Media Development Supervisor: Richard Graves Editorial Assistant: Adrienne Porter Cartoons: Rich Tennant (www.the5thwave.com) Composition Project Coordinator: Nancee Reeves Layout and Graphics: Carl Byers, Andrea Dahl, Lauren Goddard, Barry Offringa, Julie Trippetti Proofreaders: Laura Albert, Leeann Harney, Jessica Kramer, Carl Pierce, TECHBOOKS Production Services Indexer: TECHBOOKS Production Services Special Help: Microsoft Corporation Publishing and Editorial for Technology Publishing Richard Swadley, Vice President and Executive Group Publisher Barry Pruett, Vice President and Publisher, Visual/Web Graphics Andy Cummings, Vice President and Publisher, Technology Dummies Mary Bednarek, Executive Acquisitions Director, Technology Dummies Mary C. Corder, Editorial Director, Technology Dummies Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Joyce Pepple, Acquisitions Director Composition Services Gerry Fahey, Vice President of Production Services Debbie Stailey, Director of Composition Services
Contents at a Glance Introduction...1 Part I: Getting Started with Excel Formulas and Functions...7 Chapter 1: Understanding Fundamentals, Formulas, and Functions...9 Chapter 2: Saving Time with the Insert Function Dialog Box...41 Chapter 3: Understanding Array Formulas and Functions...53 Chapter 4: Correcting Formulas...63 Part II: Evaluating Loans and Investments...79 Chapter 5: Calculating Loan Payments and Interest Rates...81 Chapter 6: Performing Advanced Financial Calculations...97 Part III: Working with Numbers...113 Chapter 7: Using Math Functions to Figure Basic Math Answers...115 Chapter 8: Getting More Advanced with Math...133 Chapter 9: Using Descriptive Statistical Functions...151 Chapter 10: Using Significance Tests...189 Chapter 11: Using Prediction and Probability Functions...199 Part IV: Working with Data...217 Chapter 12: Working with Date Functions...219 Chapter 13: Keeping Track with Time Functions...237 Chapter 14: Using Lookup, Logical, and Reference Functions...245 Chapter 15: Working with Information Functions...273 Chapter 16: Working with Text Functions...287 Chapter 17: Summarizing Data with Database Functions...313 Part V: The Part of Tens...331 Chapter 18: Ten + One Great Tips for Working with Formulas...333 Chapter 19: Top Ten Functions You Must Know to Be an Excel Guru...347 Chapter 20: Ten Cool Things to Do with the Analysis ToolPak Add-In...353 Index...367
Table of Contents Introduction...1 About This Book...1 How to Use This Book...2 What You Can Safely Ignore...2 Foolish Assumptions...2 How This Book Is Organized...3 Part I: Getting Started with Excel Formulas and Functions...3 Part II: Evaluating Loans and Investments...3 Part III: Working with Numbers...3 Part IV: Working with Data...4 Part V: The Part of Tens...4 Icons Used in This Book...4 Where to Go from Here...5 Part I: Getting Started with Excel Formulas and Functions...7 Chapter 1: Understanding Fundamentals, Formulas, and Functions................................................9 Working with Excel Fundamentals...10 Understanding workbooks and worksheets...10 Working with rows, columns, cells, and ranges...13 Formatting your data...18 Getting help...20 Gaining the Upper Hand on Formulas...21 Entering your first formula...22 Understanding references...23 Copying formulas with the fill handle...25 Assembling formulas the right way...27 Using Functions in Formulas...29 Looking at what goes into a function...30 Discovering usages of a function s arguments...31 Nesting functions...35 Using array functions...37 Chapter 2: Saving Time with the Insert Function Dialog Box.......41 Getting Familiar with the Insert Function Dialog Box...41 Finding the Correct Function...43
xii Excel Formulas and Functions For Dummies Entering Functions Using the Insert Function Dialog Box...44 Selecting a function that takes no arguments...45 Selecting a function that takes arguments...47 Entering cell and range references as function arguments...49 Getting Help while Using the Insert Function Dialog Box...52 Using the Function Arguments Dialog Box to Edit Functions...52 Chapter 3: Understanding Array Formulas and Functions.........53 Discovering Arrays...53 Using Arrays in Formulas...55 Working with Functions That Return Arrays...58 Chapter 4: Correcting Formulas................................63 Catching Errors as They re Entered...63 Getting parentheses to match...64 Avoiding circular references...66 Mending broken links...67 Using the formula error checker...70 Auditing Formulas...72 Part II: Evaluating Loans and Investments...79 Chapter 5: Calculating Loan Payments and Interest Rates.........81 Understanding How Excel Handles Money...82 Going with the cash flow...82 Formatting for dollars...82 Choosing your separators...84 Figuring the Numbers on Your Loans...85 Calculating loan payments with PMT...86 Using IPMT to calculate interest payments...87 Using PPMT to calculate payments toward principal...89 Calculating the number of payments with NPER...91 Using RATE to calculate the interest rate...92 Using PV to calculate the principal on a loan...94 Chapter 6: Performing Advanced Financial Calculations..........97 Looking into the Future with FV...97 Depreciating the Finer Things in Life...100 Calculating straight line depreciation...102 Using the SYD function for accelerated depreciation...103 Creating an accelerated depreciation schedule with the DDB function...104 Calculating a depreciation schedule that starts in the middle of a year...106 Measuring Your Internals...107
Table of Contents xiii Part III: Working with Numbers...113 Chapter 7: Using Math Functions to Figure Basic Math Answers........................................115 Adding It All Together with the SUM Function...115 Rounding Out Your Knowledge of Rounding Functions...119 Just plain old rounding...120 Rounding in one direction...121 Leaving All the Decimals Behind with the INT Function...127 Leaving Some of the Decimals behind with the TRUNC Function...129 Looking for a Sign...129 Ignoring Signs...131 Chapter 8: Getting More Advanced with Math..................133 Using the PI Function to Calculate Circumference and Diameter...133 Generating and Using Random Numbers...134 Determining the Ways Items Can Be Ordered...138 Combining Items with the COMBIN Function...139 Raising Numbers to New Heights with the POWER Function...140 Multiplying Multiple Numbers with the PRODUCT function...141 Using SUMPRODUCT to Multiply and Sum Positional Values in One Step...142 Using What Remains with the MOD Function...144 Getting Just the Answer You Need with SUBTOTAL...146 Using SUMIF to Tally Only What s Needed...147 Chapter 9: Using Descriptive Statistical Functions..............151 Deciding Where the Middle Is with AVERAGE, MEDIAN, and MODE...152 Deviating from the Middle...157 Measuring variance...157 Analyzing deviations...160 Comparing sets of data for similarity...169 Putting Numbers Where They Belong...173 Going for the Count...184 Chapter 10: Using Significance Tests..........................189 Testing to the T...190 Comparing Results to an Estimate...194 Chapter 11: Using Prediction and Probability Functions.........199 Getting It Straight: Using SLOPE and INTERCEPT to Describe Linear Data...201 What s in the Future: Using FORECAST, TREND, and GROWTH to Make Predictions...205 Using NORMDIST and POISSON to Determine Probabilities...210