11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 21: Tools and Methods for Debugging <strong>Formula</strong>s 577<br />

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

blank cells are really blank cells. Here’s how to search for cells that contain only blank characters:<br />

1. Press Ctrl+F to display the Find and Replace dialog box.<br />

2. In the Find What box, enter * *. That’s an asterisk, followed by a space, and followed by<br />

another asterisk.<br />

3. Make sure the Match Entire Cell Contents check box is selected.<br />

4. Click Find All.<br />

If any cells that contain only space characters are found, you’ll be able to spot them in the list displayed<br />

at the bottom of the Find and Replace dialog box.<br />

Extra space characters<br />

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

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

been imported from another source.<br />

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

entries are not deleted. It’s impossible to tell just by looking at a cell whether text contains one or<br />

more trailing space characters.<br />

The TRIM function removes leading spaces, trailing spaces, and multiple spaces within a text string.<br />

Figure 21-1 shows some text in column A. The formula in B1, which was copied down the column, is<br />

=TRIM(A1)=A1<br />

This formula returns FALSE if the text in column A contains leading spaces, trailing spaces, or<br />

multiple spaces. In this case, the word Dog in cell A3 contains a trailing space.<br />

Figure 21-1: Using a formula to identify cells that contain extra space characters.

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

Saved successfully!

Ooh no, something went wrong!