11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

370<br />

Part IV: Array <strong>Formula</strong>s<br />

In this case, you can use Excel’s SUMPRODUCT function to obtain the same result without<br />

using an array formula:<br />

=SUMPRODUCT(B2:B7,C2:C7)<br />

As you’ll see, however, array formulas allow many other types of calculations that are<br />

otherwise not possible.<br />

Creating an array constant<br />

The examples in the previous section used arrays stored in worksheet ranges. The examples in<br />

this section demonstrate an important concept: An array does not have to be stored in a range of<br />

cells. This type of array, which is stored in memory, is referred to as an array constant.<br />

You create an array constant by listing its items and surrounding them with curly brackets. Here’s<br />

an example of a five-item horizontal array constant:<br />

{1,0,1,0,1}<br />

The following formula uses the SUM function, with the preceding array constant as its argument.<br />

The formula returns the sum of the values in the array (which is 3). Notice that this formula uses<br />

an array, but it is not an array formula. Therefore, you do not use Ctrl+Shift+Enter to enter the<br />

formula.<br />

=SUM({1,0,1,0,1})<br />

When you specify an array directly (as shown previously), you must provide the curly<br />

brackets around the array elements. When you enter an array formula, on the other<br />

hand, you do not supply the curly brackets.<br />

At this point, you probably don’t see any advantage to using an array constant. The formula that<br />

follows, for example, returns the same result as the previous formula:<br />

=SUM(1,0,1,0,1)<br />

Keep reading, and the advantages will become apparent.<br />

Following is a formula that uses two array constants:<br />

=SUM({1,2,3,4}*{5,6,7,8})

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

Saved successfully!

Ooh no, something went wrong!