18.11.2014 Views

Microsoft Office

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

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

Part II<br />

Working with Formulas and Functions<br />

When a number isn’t treated as a number<br />

If you import data into Excel, you may be aware of a common problem: Sometimes the imported values are<br />

treated as text. Here’s a quick way to convert these non-numbers to actual values. Activate any empty cell<br />

and choose Home ➪ Clipboard ➪ Copy (or press Ctrl+C). Then select the range that contains the values you<br />

need to fix. Choose Home ➪ Clipboard ➪ Paste Special. In the Paste Special dialog box, select the Add operation<br />

and then click OK. This procedure essentially adds zero to each cell — and, in the process, forces Excel<br />

to treat the non-numbers as actual values.<br />

Excel may display a Smart Tag to identify numbers stored as text. If the cell contains a Smart Tag, you’ll see a<br />

small rectangle in the upper left corner of the cells. Activate the cell, and you can respond to the Smart Tag.<br />

To force the number to be treated as an actual number, select Convert To Number on the Smart Tag’s list of<br />

options.<br />

Numbers as text<br />

As I mentioned, Excel distinguishes between numbers and text. If you want to force a number to be considered<br />

as text, you can do one of the following:<br />

n<br />

Apply the Text Number format to the cell. To do so, use the Number Format drop-down list on<br />

the Number group of the Home tab. If you haven’t applied other horizontal alignment formatting,<br />

the value will appear left-aligned (like normal text) in the cell.<br />

n Precede the number with an apostrophe. The apostrophe isn’t displayed, but the cell entry will be<br />

treated as if it were text.<br />

Even though a cell is formatted as Text (or it uses an apostrophe), you can still perform some mathematical<br />

operations on the cell if the entry looks like a number. For example, assume cell A1 contains a value preceded<br />

by an apostrophe. The formula that follows displays the value in A1, incremented by 1:<br />

=A1+1<br />

Functions, however, treat the contents of cell A1 as 0, which gives you an incorrect result. Here’s an<br />

example:<br />

=SUM(A1:A10)<br />

Bottom line? Be aware of Excel’s inconsistency in how it treats a number formatted as text; the accompanying<br />

sidebar is a good place to start.<br />

Text Functions<br />

Excel has an excellent assortment of worksheet functions that can handle text. You can access these functions<br />

just where you’d expect: from the Text control in the Function Library group of the Formula tab.<br />

206

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

Saved successfully!

Ooh no, something went wrong!