18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

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

Creating Formulas That Count and Sum 14<br />

Counting nonblank cells<br />

To count nonblank cells, use the COUNTA function. The following formula uses the COUNTA function to<br />

return the number of nonblank cells in a range named Data:<br />

=COUNTA(Data)<br />

The COUNTA function counts cells that contain values, text, or logical values (TRUE or FALSE).<br />

NOTE<br />

If a cell contains a formula that returns an empty string, that cell is included in the count<br />

returned by COUNTA, even though the cell appears to be blank.<br />

Counting numeric cells<br />

To count only the numeric cells in a range, use the following formula (which assumes the range is named<br />

Data):<br />

=COUNT(Data)<br />

Cells that contain a date or a time are considered to be numeric cells. Cells that contain a logical value<br />

(TRUE or FALSE) aren’t considered to be numeric cells.<br />

Counting text cells<br />

To count the number of text cells in a range, you need to use an array formula. The array formula that follows<br />

returns the number of text cells in a range named Data:<br />

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

Counting nontext cells<br />

The following array formula uses Excel’s ISNONTEXT function, which returns TRUE if its argument refers to<br />

any nontext cell (including a blank cell). This formula returns the count of the number of cells not containing<br />

text (including blank cells):<br />

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

Counting logical values<br />

The following array formula returns the number of logical values (TRUE or FALSE) in a range named Data:<br />

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

Counting error values in a range<br />

Excel has three functions that help you determine whether a cell contains an error value:<br />

n<br />

n<br />

n<br />

ISERROR: Returns TRUE if the cell contains any error value (#N/A, #VALUE!, #REF!, #DIV/0!,<br />

#NUM!, #NAME?, or #NULL!)<br />

ISERR: Returns TRUE if the cell contains any error value except #N/A<br />

ISNA: Returns TRUE if the cell contains the #N/A error value<br />

253

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

Saved successfully!

Ooh no, something went wrong!