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

A multicell array formula<br />

Figure 17.1 shows a simple worksheet set up to calculate product sales. Normally, you’d calculate the value<br />

in column D (total sales per product) with a formula such as the one that follows, and then you’d copy this<br />

formula down the column.<br />

=B2*C2<br />

After copying the formula, the worksheet contains six formulas in column D.<br />

FIGURE 17.1<br />

Column D contains formulas to calculate the total for each product.<br />

An alternative method uses a single formula (an array formula) to calculate all six values in D2:D7. This single<br />

formula occupies six cells and returns an array of six values.<br />

To create a single array formula to perform the calculations, follow these steps:<br />

1. Select a range to hold the results. In this case, the range is D2:D7.<br />

2. Enter the following formula:<br />

=B2:B7*C2:C7<br />

3. Press Ctrl+Shift+Enter to enter the formula. Normally, you press Enter to enter a formula.<br />

Because this is an array formula, however, press Ctrl+Shift+Enter.<br />

You can’t insert a multicell array formula into a range that has been designated a table. You<br />

designate a table using the Excel 2007 Insert ➪ Tables ➪ Table command). In addition, you<br />

can’t convert a range that contains a multicell array formula to a table.<br />

CAUTION<br />

The formula is entered into all six of the selected cells. If you examine the Formula bar, you see the following:<br />

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

Excel places curly brackets around the formula to indicate that it’s an array formula.<br />

This formula performs its calculations and returns a six-item array. The array formula actually works with<br />

two other arrays, both of which happen to be stored in ranges. The values for the first array are stored in<br />

B2:B7, and the values for the second array are stored in C2:C7.<br />

Because you can’t display more than one value in a single cell, six cells are required to display the resulting<br />

array — which explains why you selected six cells before you entered the array formula.<br />

314

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

Saved successfully!

Ooh no, something went wrong!