11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

8. Replace the reference to cell D1 with the formula in cell D1.<br />

The formula now looks like this:<br />

=LEFT(B1,C1–1)&” “&RIGHT(B1,LEN(B1)–IFERROR<br />

(FIND(“ “,B1,C1+1),C1))<br />

Chapter 20: Creating Megaformulas 561<br />

9. The formula has three references to cell C1. Replace all three of those references to cell C1<br />

with the formula contained in cell C1.<br />

The formula in cell H1 is as follows:<br />

=LEFT(B1,FIND(“ “,B1)–1)&” “&RIGHT(B1,LEN(B1)–IFERROR<br />

(FIND(“ “,B1,FIND(“ “,B1)+1),FIND(“ “,B1)))<br />

10. Finally, replace the seven references to cell B1 with the formula in cell B1. The result is<br />

=LEFT(TRIM(A1),FIND(“ “,TRIM(A1))–1)&” “&RIGHT<br />

(TRIM(A1),LEN(TRIM(A1))–IFERROR(FIND(“ “,TRIM(A1),<br />

FIND(“ “,TRIM(A1))+1),FIND(“ “,TRIM(A1))))<br />

Notice that the formula in cell H1 now contains references only to cell A1. The megaformula is<br />

complete, and it performs exactly the same tasks as all the intermediate formulas (which you can<br />

now delete).<br />

After you create a megaformula, you can create a name for it to simplify using the formula.<br />

Here’s an example:<br />

1. Copy the megaformula text to the Clipboard.<br />

In this example, the megaformula refers to cell A1.<br />

2. Activate cell B1, which is the cell to the right of the cell referenced in the megaformula.<br />

3. Choose <strong>Formula</strong>s➜Defined Names➜Define Name to display the New Name dialog box.<br />

4. In the Name field, type NoMiddleName.<br />

5. Activate the Refers To field, and press Ctrl+V to paste the megaformula text.<br />

6. Click OK to close the New Name dialog box.<br />

After performing these steps and creating the named formula, you can enter the following formula,<br />

and it will return the result using the cell directly to the left:<br />

=NoMiddleName<br />

If you enter this formula in cell K8, it displays the name in cell J8, with no middle name.<br />

See Chapter 3 for more information about creating and using named formulas.

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

Saved successfully!

Ooh no, something went wrong!