Section 10.7. Doing Math in Tables


10.7. Doing Math in Tables

When presenting numbers in your document, whether it's a budget, or sales figures, or an inventory tally, you probably want to total some of the columns . Sure, you could add up the numbers on a calculator, and then type the totals into the cells . That's fine if you know the figures aren't going to change, and you're certain you won't transpose any figures between your calculator and the table. A better (though, admittedly, not necessarily easier) way is to insert one of Word's fields with instructions to sum the column above. Use the Formula button (Figure 10-16) on the Layout tab to insert the field into your table.

Figure 10-16. Use the Formula button (Table Tools Layout Data Formula) to insert a math field into your table.


Here are the steps for adding a SUM field that totals the number in the column above:

  1. Click to place the insertion point in the bottom cell of a column with numbers, and then go to Table Tools Layout Data Formula .

    The Formula dialog box opens (Figure 10-17). Word makes some assumptions based on the fact that the insertion point is at the bottom of a column of numbers. For example, the Formula box is preloaded with a formula designed to total the column of numbers. It's almost as readable as plain English: =SUM(ABOVE). If your insertion point had been at the end of a row of numbers, the formula would have read: =SUM(LEFT).

  2. In the Formula box, check to make sure the formula does what you want, and then click OK .

    Word inserts the field code in the cell, and then it runs the calculationin this case, a sum, which then shows up in the cell.

It's not unusual to have several columns that you want to total. If that's the case, you can select the cell with the SUM field, and then press Ctrl+C to copy it. Then move the insertion point to the next cell, and then press Ctrl+V to paste it. At this point, you may notice that the numbers don't add up right. That's because you need to update the function field. Word tables may look a little like spreadsheets, but unlike Excel and most other spreadsheet programs, Word doesn't automatically recalculate formulas when you edit cells. If you change numbers in a row or a column that's summed with a field, you need to update the SUM fields just like any other Word field (Section 3.4). Click to place the insertion point in the field, and then press F9. Word runs the math again, and then places the correct number in the cell. To update all the fields in a table, select the entire table (Alt+JL, KT), and then press F9.

Figure 10-17. If all you're doing is summing a column of numbers, the Formula box is pretty easy to manage. In the top text box, you see the actual formula that Word uses to create the text it places in the cell. Use the "Number format" box if you want the total to show as currency. The Paste function box leads to other formulas such as average, round, and count.


UP TO SPEED
Other Table-Like Options

When you need to organize parts of your document separate from the body text, you have a few different options. You can use either tables or text boxes to separate blocks of text from the body of your document. If you're working with numbers, you can use a table, or you can insert an Excel spreadsheet into your document. When you're working with columns of newspaper-style text, you can use Word's columns or you can use a table. So the question arises, when should you use tables for these jobs and when should you use an alternative? Here are some rules of thumb:

  • For a pull quote or a sidebar, it's better to use a text box than a table to hold the text. The end result may look pretty much the same no matter which you use, but text boxes provide easier, quicker formatting options. The details for creating and using text boxes begin in Section 14.2.3. The only time you can consider using a table is when you need multiple columns. You can't do multiple columns in a text box, but you can fake multiple columns in a table by placing text in two different columns of a table, and then hiding the border lines. Use tables to create grid-like charts and for simple text-based projects. You can also use tables for simple projects like budgets and reports that total columns and rows of numbers.

  • However, if you need to do more complicated math formulas, it's easier to insert an Excel spreadsheet into your Word document. The printed page will look the same, but it's easier to create and update the formulas in a spreadsheet. Find more details on embedding Excel spreadsheets and other objects in Section 11.5.

  • Word's columns are fine for text that flows evenly and predictably from one column to another, but they're murder if you're trying to organize a page with irregularly shaped text. So, for example, if you're creating a newsletter with blocks of text of different shapes and sizes, it's probably easier to create a table with a few cells, and then place blocks of text inside the cells. Tables are great for accurately positioning items next to each other.

  • Last but not least, if you're pulling your hair out while trying to align items with tabs and paragraph marks, it's time to consider using a table for the job. Tables give you much better control when you're aligning items. What's more, you can automatically turn that text with the tabs into a table with the command Insert Tables Table Convert Text to Table or the keyboard shortcut Alt+N, TE.




Word 2007[c] The Missing Manual
Word 2007[c] The Missing Manual
ISBN: 059652739X
EAN: N/A
Year: 2006
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net