Sculpt

Professional Excel development

countif

leave a comment »

As with the basic SUMIF function, you might want to perform COUNTIF using multiple criteria?

Use this array formula – you can use named ranges, as in the example. However, the named range must refer to the same rows: i.e. you could use named ranges referring to A2:A1000 and B2:B1000, but A2:A500 and B2:B2000 would not work.

{=SUM((CData=$A$9)*(BData=$B$9))}

This counts the number of records where the named range CData = $A$9 AND BData = $B$9.

You must press CTRL + SHIFT + ENTER for the array formula to function.

The above example functions as an AND statement. You can modify this to an OR by replacing * with +, counting the number of records where CData = $A$9 OR BData = $B$9:

{=SUM((CData=$A$9)+(BData=$B$9))}

Written by Austin

January 3, 2007 at 7:23 pm

Posted in arrays, count if, functions

Leave a comment