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 />

Using Excel’s Formula Evaluator<br />

If you would like to better understand how some of these complex array formulas work, consider using a<br />

handy tool: The Formula Evaluator. Select the cell that contains the formula and then choose Formulas ➪<br />

Formula Auditing ➪ Evaluate Formula. You’ll see the Evaluate Formula dialog box shown in the figure.<br />

Click the Evaluate button repeatedly to see the intermediate results as the formula is being calculated. It’s like<br />

watching a formula calculate in slow motion.<br />

This formula works only when the Data range consists of a single column of values. It does not work for a<br />

multicolumn range or for a single row of values.<br />

To make the formula work with a horizontal range, you need to transpose the array of integers generated by<br />

the ROW function. Excel’s TRANPOSE function is just the ticket. The modified array formula that follows<br />

works only with a horizontal Data range:<br />

{=IF(n=0,0,SUM(IF(MOD(TRANSPOSE(ROW(INDIRECT(“1:”&COUNT(Data))))-<br />

1,n)=0,Data,””)))}<br />

Removing non-numeric characters from a string<br />

The following array formula extracts a number from a string that contains text. For example, consider the<br />

string ABC145Z. The formula returns the numeric part, 145.<br />

{=MID(A1,MATCH(0,(ISERROR(MID(A1,ROW(INDIRECT<br />

(“1:”&LEN(A1))),1)*1)*1),0),LEN(A1)-SUM((ISERROR<br />

(MID(A1,ROW(INDIRECT(“1:”&LEN(A1))),1)*1)*1)))}<br />

This formula works only with a single embedded number. For example, it fails with a string like X45Z99<br />

because the string contains two embedded numbers.<br />

342

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

Saved successfully!

Ooh no, something went wrong!