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

FIGURE 17.14<br />

The goal is to count the number of characters in a range of text.<br />

The array formula uses the LEN function to create a new array (in memory) that consists of the number of<br />

characters in each cell of the range. In this case, the new array is<br />

{10,9,8,5,6,5,5,10,11,14,6,8,8,7}<br />

The array formula is then reduced to:<br />

=SUM({10,9,8,5,6,5,5,10,11,14,6,8,8,7})<br />

The formula returns the sum of the array elements, 112.<br />

Summing the three smallest values in a range<br />

If you have values in a range named Data, you can determine the smallest value by using the SMALL function:<br />

=SMALL(Data,1)<br />

You can determine the second smallest and third smallest values by using these formulas:<br />

=SMALL(Data,2)<br />

=SMALL(Data,3)<br />

To add the three smallest values, you could use a formula like this:<br />

=SUM(SMALL(Data,1), SMALL(Data,2), SMALL(Data,3)<br />

This formula works fine, but using an array formula is more efficient. The following array formula returns<br />

the sum of the three smallest values in a range named Data:<br />

{=SUM(SMALL(Data,{1,2,3}))}<br />

The formula uses an array constant as the second argument for the SMALL function. This generates a new<br />

array, which consists of the three smallest values in the range. This array is then passed to the SUM function,<br />

which returns the sum of the values in the new array.<br />

328

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

Saved successfully!

Ooh no, something went wrong!