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

This formula creates a new array that consists only of the nonzero values in the range. The AVERAGE function<br />

then uses this new array as its argument.<br />

You also can get the same result with a regular (non-array) formula:<br />

=SUM(B5:B12)/COUNTIF(B5:B12,”0”)<br />

This formula uses the COUNTIF function to count the number of nonzero values in the range. This value is<br />

divided into the sum of the values.<br />

Determining whether a particular value appears in a range<br />

To determine whether a particular value appears in a range of cells, you can choose Edit ➪ Find and do a<br />

search of the worksheet. But you also can make this determination by using an array formula.<br />

Figure 18.3 shows a worksheet with a list of names in A5:E24 (named NameList). An array formula in cell<br />

D3 checks the name entered into cell C3 (named TheName). If the name exists in the list of names, the formula<br />

displays the text Found. Otherwise, it displays Not Found.<br />

FIGURE 18.3<br />

Using an array formula to determine whether a range contains a particular value.<br />

The array formula in cell D3 is<br />

{=IF(OR(TheName=NameList),”Found”,”Not Found”)}<br />

336

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

Saved successfully!

Ooh no, something went wrong!