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.

Part II<br />

Working with Formulas and Functions<br />

FIGURE 12.1<br />

The ANSI character set (for the Wingdings 3 font).<br />

The CODE function<br />

Excel’s CODE function returns the character code for its argument. The formula that follows returns 65, the<br />

character code for uppercase A:<br />

=CODE(“A”)<br />

If the argument for CODE consists of more than one character, the function uses only the first character.<br />

Therefore, this formula also returns 65:<br />

=CODE(“Abbey Road”)<br />

The CHAR function<br />

The CHAR function is essentially the opposite of the CODE function. Its argument should be a value between<br />

1 and 255, and the function should return the corresponding character. The following formula, for example,<br />

returns the letter A:<br />

=CHAR(65)<br />

To demonstrate the opposing nature of the CODE and CHAR functions, try entering this formula:<br />

=CHAR(CODE(“A”))<br />

This formula, which is illustrative rather than useful, returns the letter A. First, it converts the character to<br />

its code value (65), and then it converts this code back to the corresponding character.<br />

208

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

Saved successfully!

Ooh no, something went wrong!