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

The IFERROR function is new to Excel 2007. For compatibility with older versions, use this formula:<br />

{=IF(ISERR(SMALL(IF(Data>0,ROW(INDIRECT(“1:”&ROWS(Data)))),<br />

ROW(INDIRECT(“1:”&ROWS(Data))))),””,INDEX(Data,SMALL(IF<br />

(Data>0,ROW(INDIRECT(“1:”&ROWS(Data)))),ROW(INDIRECT<br />

(“1:”&ROWS(Data))))))}<br />

FIGURE 18.9<br />

Using an array formula to return only the positive values in a range.<br />

Returning nonblank cells from a range<br />

The following formula is a variation on the formula in the preceding section. This array formula works with<br />

a single-column vertical range named Data. The array formula is entered into a range of the same size as<br />

Data and returns only the nonblank cell in the Data range.<br />

{=IFERROR(INDEX(Data,SMALL(IF(Data””,ROW(INDIRECT(“1:”&ROWS(Data)))),<br />

ROW(INDIRECT(“1:”&ROWS(Data))))),””)}<br />

For compatibility with versions prior to Excel 2007, use this formula:<br />

{=IF(ISERR(SMALL(IF(Data””,ROW(INDIRECT(“1:”&ROWS(Data)))),<br />

ROW(INDIRECT(“1:”&ROWS(Data))))),””,INDEX(Data,SMALL(IF(Data<br />

””,ROW(INDIRECT(“1:”&ROWS(Data)))),ROW(INDIRECT(“1:”&ROWS<br />

(Data))))))}<br />

346

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

Saved successfully!

Ooh no, something went wrong!