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.

Introducing Array Formulas 17<br />

This array formula, of course, returns exactly the same values as these six normal formulas entered into<br />

individual cells in D2:D7:<br />

=B2*C2<br />

=B3*C3<br />

=B4*C4<br />

=B5*C5<br />

=B6*C6<br />

=B7*C7<br />

Using a single array formula rather than individual formulas does offer a few advantages:<br />

n<br />

n<br />

n<br />

It’s a good way of ensuring that all formulas in a range are identical.<br />

Using a multicell array formula makes it less likely that you’ll overwrite a formula accidentally.<br />

You can’t change one cell in a multicell array formula. Excel displays an error message if you<br />

attempt to do so.<br />

Using a multicell array formula will almost certainly prevent novices from tampering with your<br />

formulas.<br />

Using a multicell array formula as described in the preceding list also has some potential disadvantages:<br />

n<br />

n<br />

It’s impossible to insert a new row into the range. But in some cases, the inability to insert a row is<br />

a positive feature.<br />

If you add new data to the bottom of the range, you need to modify the array formula to accommodate<br />

the new data.<br />

A single-cell array formula<br />

Now it’s time to take a look at a single-cell array formula. Check out Figure 17.2, which is similar to Figure<br />

17.1. Notice, however, that the formulas in column D have been deleted. The goal is to calculate the sum of<br />

the total product sales without using the individual calculations that were in column D.<br />

FIGURE 17.2<br />

The array formula in cell C10 calculates the total sales without using intermediate formulas.<br />

The following array formula is in cell C10:<br />

{=SUM(B2:B7*C2:C7)}<br />

315

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

Saved successfully!

Ooh no, something went wrong!