Using COUNTIFS with Excel 2003

Excel 2007 introduced the function COUNTIFS to count cells based on multiple criteria.

For example suppose you wish to count how many times the client Fowler buys more than 250 shares. The answer for tha data below turns out to be 2 using the Countifs function entered in B13.

Similarly for Owen the result turns out to be 1. 

 

 

 

 

 

 

 

 

 

Even though COUNTIFS is not availailable with Excel 2003 there is an alternative way to perform the same calculation using the SUMPRODUCT array formula.

The formula

 =SUMPRODUCT(–(A2:A11=”Fowler”),–(C2:C11>=250))

typed into C13 produces the same result. The mysterious looking — operator calculates if true or false for each of the cells in the range A2:A11 returning 1 if true and 0 if false. The same goes for the range C2:C11 and the Sumproduct array function sums all the true, true (1*1) combinations.

Note – To show how — works try typing –(A2:A11=”Fowler”) into a cell followed by Ctrl+Shift+Enter. This convets the formula into the array formula {=(A2:A11=”Fowler”)}