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.

132<br />

Part II: Using Functions in Your <strong>Formula</strong>s<br />

Extracting characters from a string<br />

Excel users often need to extract characters from a string. For example, you may have a list of<br />

employee names (first and last names) and need to extract the last name from each cell. Excel<br />

provides several useful functions for extracting characters:<br />

LEFT: Returns a specified number of characters from the beginning of a string.<br />

RIGHT: Returns a specified number of characters from the end of a string.<br />

MID: Returns a specified number of characters beginning at any position within a string.<br />

The formula that follows returns the last ten characters from cell A1. If A1 contains fewer than ten<br />

characters, the formula returns all of the text in the cell.<br />

=RIGHT(A1,10)<br />

This next formula uses the MID function to return five characters from cell A1, beginning at character<br />

position 2. In other words, it returns characters 2–6.<br />

=MID(A1,2,5)<br />

Transforming data with formulas<br />

Many of the examples in this chapter describe how to use functions to transform data in some<br />

way. For example, you can use the UPPER function to transform text into uppercase. Often,<br />

you’ll want to replace the original data with the transformed data. To do so, Paste Values over<br />

the original text. Here’s how:<br />

1. Create your formulas to transform the original data.<br />

2. Select the formula cells.<br />

3. Choose Home➜Clipboard➜Copy (or press Ctrl+C).<br />

4. Select the original data cells.<br />

5. Choose Home➜Clipboard➜Paste➜Values.<br />

After performing these steps, you can delete the formulas.<br />

The following example returns the text in cell A1, with only the first letter in uppercase (sometimes<br />

referred to as sentence case). It uses the LEFT function to extract the first character and<br />

convert it to uppercase. This then concatenates to another string that uses the RIGHT function to<br />

extract all but the first character (converted to lowercase).<br />

=UPPER(LEFT(A1))&LOWER(RIGHT(A1,LEN(A1)-1))

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

Saved successfully!

Ooh no, something went wrong!