18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Making Your Worksheets Error-Free 32<br />

Using Formula AutoCorrect<br />

When you enter a formula that has a syntax error, Excel attempts to determine the problem and offers a<br />

suggested correction. The accompanying figure shows an example of a proposed correction.<br />

Be careful when accepting corrections for your formulas from Excel because it doesn’t always guess correctly.<br />

For example, I entered the following formula (which has mismatched parentheses):<br />

=AVERAGE(SUM(A1:A12,SUM(B1:B12))<br />

Excel then proposed the following correction to the formula:<br />

=AVERAGE(SUM(A1:A12,SUM(B1:B12)))<br />

You may be tempted to accept the suggestion without even thinking. In this case, the proposed formula is syntactically<br />

correct — but not what I intended. The correct formula is<br />

=AVERAGE(SUM(A1:A12),SUM(B1:B12))<br />

Blank cells are not blank<br />

Some Excel users have discovered that by pressing the spacebar, the contents of a cell seem to erase.<br />

Actually, pressing the spacebar inserts an invisible space character, which isn’t the same as erasing the cell.<br />

For example, the following formula returns the number of nonempty cells in range A1:A10. If you “erase”<br />

any of these cells by using the spacebar, these cells are included in the count, and the formula returns an<br />

incorrect result.<br />

=COUNTA(A1:A10)<br />

If your formula doesn’t ignore blank cells the way that it should, check to make sure that the blank cells are<br />

really blank cells. One way is to choose Home ➪ Editing ➪ Find & Select ➪ Go To (or press F5 or<br />

Ctrl+G), which displays the Go To dialog box. Click the Special button and then choose the Blanks option<br />

in the Go To Special dialog box. Excel will select all blank cells so that you can spot cells that appear to be<br />

empty but are not.<br />

Extra space characters<br />

If you have formulas or use procedures that rely on comparing text, be careful that your text doesn’t contain<br />

additional space characters. Adding an extra space character is particularly common when data has been<br />

imported from another source.<br />

Excel automatically removes trailing spaces from values that you enter, but trailing spaces in text entries are not<br />

deleted. It’s impossible to tell, just by looking at a cell, if text contains one or more trailing space characters.<br />

553

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!