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.

Yet another way to perform this count is to use an array formula:<br />

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

{=SUM((Month=”January”)*(SalesRep=”Brooks”)*(Amount>1000))}<br />

Using Or criteria<br />

To count cells by using an Or criterion, you can sometimes use multiple COUNTIF functions. The<br />

following formula, for example, counts the number of sales made in January or February:<br />

=COUNTIF(Month,”January”)+COUNTIF(Month,”February”)<br />

You can also use the COUNTIF function in an array formula. The following array formula, for<br />

example, returns the same result as the previous formula:<br />

{=SUM(COUNTIF(Month,{“January”,”February”}))}<br />

But if you base your Or criteria on cells other than the cells being counted, the COUNTIF function<br />

won’t work. (Refer to Figure 7-2.) Suppose that you want to count the number of sales that meet<br />

the following criteria:<br />

Month is January, or<br />

SalesRep is Brooks, or<br />

Amount is greater than 1,000<br />

If you attempt to create a formula that uses COUNTIF, some double counting will occur. The solution<br />

is to use an array formula like this:<br />

{=SUM(IF((Month=”January”)+(SalesRep=”Brooks”)+(Amount>1000),1))}<br />

Combining And and Or criteria<br />

In some cases, you may need to combine And and Or criteria when counting. For example, perhaps<br />

you want to count sales that meet the following criteria:<br />

Month is January, and<br />

SalesRep is Brooks, or SalesRep is Cook<br />

You can add two COUNTIFS functions to get the desired result:<br />

=COUNTIFS(Month,”January”,SalesRep,”Brooks”)+<br />

COUNTIFS(Month,”January”,SalesRep,”Cook”)

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

Saved successfully!

Ooh no, something went wrong!