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.

204<br />

Part II: Using Functions in Your <strong>Formula</strong>s<br />

A range reference<br />

A logical TRUE value<br />

The SUM function is versatile, but it’s also inconsistent when you use logical values<br />

(TRUE or FALSE). Logical values stored in cells are always treated as 0. But logical<br />

TRUE, when used as an argument in the SUM function, is treated as 1.<br />

Computing a cumulative sum<br />

You may want to display a cumulative sum of values in a range — sometimes known as a running<br />

total. Figure 7-13 illustrates a cumulative sum. Column B shows the monthly amounts, and column<br />

C displays the cumulative (year-to-date) totals.<br />

Figure 7-13: Simple formulas in column C display a cumulative sum of the values in column B.<br />

The formula in cell C2 is<br />

=SUM(B$2:B2)<br />

Notice that this formula uses a mixed reference. The first cell in the range reference always refers<br />

to the same row (in this case, row 2). When this formula is copied down the column, the range<br />

argument adjusts such that the sum always starts with row 2 and ends with the current row. For<br />

example, after copying this formula down column C, the formula in cell C8 is<br />

=SUM(B$2:B8)<br />

You can use an IF function to hide the cumulative sums for rows in which data hasn’t been<br />

entered. The following formula, entered in cell C2 and copied down the column, is<br />

=IF(ISBLANK(B2),””,SUM(B$2:B2))

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

Saved successfully!

Ooh no, something went wrong!