Word can add! Seriously, if you’re using Word and you need a few basic calculations, you don’t have to insert an Excel sheet. You can use a Word table and let Word do the calculating. The feature’s limited, but it’s perfectly capable of the basics. (AutoSum seems to be absent from Word 2007, but you can still insert formulas.)
First, Word uses table cell coordinates to determine the values it evaluates. Notice that the table below has an empty column to the right and an empty row at the bottom. That’s where we’ll perform calculations on the existing values.
Simply click in a cell to the right or below a contiguous row or column and click the AutoSum button on the Tables And Borders toolbar. (To display this toolbar, choose Toolbars from the View menu,and check Tables And Borders.) For example, to sum the units sold in the north by all representatives, click the blank cell just below those values (and to the right of the Total row’s heading cell) and click AutoSum. As you can see, the total number of units for the north is 66. AutoSum automatically summed all of the values above the current cell. (It will stop at an empty cell.)
To total the units sold by Harkins (all four regions), click inside the empty cell at the far right of the Harkins row, just under Total, and click AutoSum. This time, AutoSum determined that the values were to the left.
But what happens when AutoSum encounters values to the left and above? To find out, select the empty cell at the far right of the Smith column (just below the current cell) and click AutoSum. This time, it sums the value(s) above; that’s the default.
When this happens, you must tell the current formula to evaluate the values to the left instead. To do so, press [Alt]+[F9] to display codes. As you can see below, the actual formula reference is ABOVE. Simply highlight the ABOVE reference and replace it with LEFT.
Next, press [Alt]+[F9] to hide the codes and then press [F9] to recalculate. Now, the formula sums the values to the left.
If you know about AutoSum’s default, you can use the Formula command on the Table menu as follows (in Word 2007, Formula is in the Data group on the Layout tab):
- Select the cell in question. In this case, select the empty cell to the far right of the Nichols row.
- Choose Formula from the Table menu.
- In the resulting dialog box, Word will display the default formula, which references the values above.
- Change ABOVE to LEFT, and click OK.
You can also use the Formula command when you want to specify individual values. That’s because Word assigns an identifying value to each cell in the table. Every cell has two identifiers, a row identifier (a number) and a column identifier (a letter). For example, the first cell in the top-left corner is A1. The next cell to the right is B1. The cell just below A1 is A2, and so on. When evaluating individual values, separate them using a comma as follows:
In addition, you can substitute the default formula with a variety of functions. Simply delete all of the default formula, except for the equal sign, and then choose a function from the Paste Function drop-down list.
This flexible but somewhat limited feature has a lot to offer. However, you must remember to recalculate the file each time you change a value in the table. Word will not update formulas automatically. Simply select the entire table and press [F9] and Word will reevaluate all the formulas in the table. Or highlight an individual cell and press [F9] to recalculate a single formula.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays