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.

Chapter 15: Performing Magic with Array <strong>Formula</strong>s 401<br />

The following array formula creates a new array that consists of values in column E, rounded to<br />

two decimal places:<br />

{=SUM(ROUND(E4:E6,2))}<br />

This formula returns $168.31.<br />

You also can eliminate these types of rounding errors by using the ROUND function in the formula<br />

that calculates each row total in column E (which does not require an array formula).<br />

Summing every nth value in a range<br />

Suppose that you have a range of values and you want to compute the sum of every third value<br />

in the list — the first, the fourth, the seventh, and so on. One solution is to hard-code the cell<br />

addresses in a formula. But a better solution is to use an array formula.<br />

In Figure 15-6, the values are stored in a range named Data, and the value of n is in cell<br />

D4 (named n).<br />

Figure 15-6: An array formula returns the sum of every nth value in the range.<br />

The following array formula returns the sum of every nth value in the range:<br />

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

This formula returns 70, which is the sum of every third value in the range.

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

Saved successfully!

Ooh no, something went wrong!