11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7: Counting and Summing Techniques 185<br />

You can access the basic counting.xlsx workbook shown in Figure 7-1 on the companion<br />

CD-ROM.<br />

Counting the total number of cells<br />

To get a count of the total number of cells in a range, use the following formula. This formula<br />

returns the number of cells in a range named Data. It simply multiplies the number of rows<br />

(returned by the ROWS function) by the number of columns (returned by the COLUMNS function).<br />

=ROWS(Data)*COLUMNS(Data)<br />

Counting blank cells<br />

The following formula returns the number of blank (empty) cells in a range named Data:<br />

=COUNTBLANK(Data)<br />

The COUNTBLANK function also counts cells containing a formula that returns an empty string.<br />

For example, the formula that follows returns an empty string if the value in cell A1 is greater<br />

than 5. If the cell meets this condition, the COUNTBLANK function counts that cell.<br />

=IF(A1>5,””,A1)<br />

The COUNTBLANK function does not count cells that contain a zero value, even if you<br />

clear the Show a Zero in Cells That Have Zero Value option in the Excel Options dialog<br />

box. (Choose File➜Options and navigate to the Display Options for this Worksheet section<br />

of the Advanced tab.)<br />

You can use the COUNTBLANK function with an argument that consists of entire rows or columns.<br />

For example, this next formula returns the number of blank cells in column A:<br />

=COUNTBLANK(A:A)<br />

The following formula returns the number of empty cells on the entire worksheet named Sheet1.<br />

You must enter this formula on a sheet other than Sheet1, or it will create a circular reference.<br />

=COUNTBLANK(Sheet1!1:1048576)

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

Saved successfully!

Ooh no, something went wrong!