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 />

=COUNTIF(Data,”*budget*”)<br />

=COUNTIF(Data,”A*”)<br />

=COUNTIF(Data,TODAY())<br />

Returns the number of cells containing the text budget anywhere within the<br />

text<br />

Returns the number of cells containing text that begins with the letter A (not<br />

case sensitive):<br />

Returns the number of cells containing the current date<br />

=COUNTIF(Data,”>”&AVERAGE(Data)) Returns the number of cells with a value greater than the average<br />

=COUNTIF(Data,”>”&AVERAGE(Data)+ Returns the number of values exceeding three standard deviations above<br />

STDEV(Data)*3)<br />

the mean<br />

=COUNTIF(Data,3)+COUNTIF(Data,-3) Returns the number of cells containing the value 3 or –3<br />

=COUNTIF(Data,TRUE)<br />

Returns the number of cells containing logical TRUE<br />

=COUNTIF(Data,TRUE)+<br />

Returns the number of cells containing a logical value (TRUE or FALSE)<br />

COUNTIF(Data,FALSE)<br />

=COUNTIF(Data,”#N/A”)<br />

Returns the number of cells containing the #N/A error value<br />

Counting cells by using multiple criteria<br />

In many cases, your counting formula will need to count cells only if two or more criteria are met. These<br />

criteria can be based on the cells that are being counted or based on a range of corresponding cells.<br />

Figure 14.2 shows a simple worksheet that I use for the examples in this section. This sheet shows sales<br />

data categorized by Month, SalesRep, and Type. The worksheet contains named ranges that correspond to<br />

the labels in row 1.<br />

ON the CD-ROM<br />

This workbook is available on the companion CD-ROM. The file is named multiple criteria<br />

counting.xlsx.<br />

Several of the examples in this section use the COUNTIFS function, which is new to Excel<br />

2007. I also present alternative versions of the formulas, which should be used if you plan to<br />

share your workbook with others who don’t use Excel 2007.<br />

NEW FEATURE<br />

FIGURE 14.2<br />

This worksheet demonstrates various counting techniques that use multiple criteria.<br />

255

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

Saved successfully!

Ooh no, something went wrong!