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.

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

The new AGGREGATE function, which works only in Excel 2010, provides another way<br />

to sum a range that contains one or more error values. Here’s an example:<br />

=AGGREGATE(9,2,C4:C10)<br />

The first argument, 9, is the code for SUM. The second argument, 2, is the code for<br />

“ignore error values.”<br />

Counting the number of error values in a range<br />

The following array formula is similar to the previous example, but it returns a count of the number<br />

of error values in a range named Data:<br />

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

This formula creates an array that consists of 1s (if the corresponding cell contains an error) and<br />

0s (if the corresponding cell does not contain an error value).<br />

You can simplify the formula a bit by removing the third argument for the IF function. If this<br />

argument isn’t specified, the IF function returns FALSE if the condition is not satisfied (that is, the<br />

cell does not contain an error value). In this context, Excel treats FALSE as a 0 value. The array<br />

formula shown here performs exactly like the previous formula, but it doesn’t use the third argument<br />

for the IF function:<br />

{=SUM(IF(ISERROR(Data),1))}<br />

Actually, you can simplify the formula even more:<br />

{=SUM(ISERROR(Data)*1)}<br />

This version of the formula relies on the fact that:<br />

TRUE * 1 = 1<br />

and<br />

FALSE * 1 = 0

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

Saved successfully!

Ooh no, something went wrong!