Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Formula Shortcuts This formula causes a divide-by-zero error if A2 contains a 0 value. Excel then dis- plays an error code in the cell. To prevent this from happening, you can replace this formula with the conditional formula shown here: =IF(A2=0, 0, A1/A2) This formula checks if cell A2 is empty or contains a 0. If so, the condition's true, and the formula simply gives you a 0. If it isn't, then the condition's false, and Excel performs the calculation A1/A2. Practical examples of conditional logic abound in Chapters 12 and 13. FREQUENTLY ASKED QUESTION Showing and Printing Formulas How in the world do I print out formulas that appear in my cells? When you print a worksheet, Excel prints the calculated value in each cell rather than any formula that happens to be inside a cell. Usually, that's what you want to happen. But in some cases, rather than a printout of the formula's results, you want a record of the calculations used to gener- ate the results. Excel gives you a view setting so you can get this record. Just choose FormulasFormula AuditingShow Formu- las. Now, Excel displays the cells' formula contents instead of the results--but on the current worksheet only. Excel also widens the columns so they can show more information (as formulas tend to be longer than their results). Repeat this process, and then uncheck the setting to return to nor- mal life. Formula Shortcuts So far, you've learned how to build a formula by entering it manually. That's a good way to start out because it forces you to understand the basics of formula writing. But writing formulas by hand is a drag; plus, it's easy to type in the wrong cell ad- dress. For example, if you type A2 instead of A3, you can end up with incorrect data, and you won't necessarily notice your mistake. As you become more comfortable with formulas, you'll find that Excel gives you a few tools--like point-and-click formula creation and the Insert Function button--to speed up your formula writing and reduce your mistakes. You'll learn about these features in the following sections. Point-and-Click Formula Creation Instead of entering a formula by typing it out letter-by-letter, Excel lets you create formulas by clicking the cells you want to use. For example, consider this simple formula that totals the numbers in two cells: =A1+A2 chapter 8: building basic formulas 245