0

Excel 2003 Equivalent to Excel 2007's COUNTIFS Function

excel

Microsoft's Excel 2007 has a new function called COUNTIFS which allows you to apply multiple criteria (up to 127) in order to arrive at your count range. Here is how I had it setup, which works great.

COUNTIFS(Employees!$D:$D,1,Employees!$L:$L,"Meets")

This counts all of the employees that have a level of 1 and a performance rating of "Meets". The problem is that this worksheet needs to be compatible to older versions of Excel, particularly 2003. Luckily, there is a pretty easy way to accomplish the same result. I googled and found this thread at www.ureader.com which mentions the use of the SUMPRODUCT function. Here is my backwards compatible version.

SUMPRODUCT(--(Employees!$D:$D=1),--(Employees!$L:$L="Meets"))

So what does this do? Well, the first argument returns an array of TRUE/FALSE values for each cell in the range. True if it equals 1, false if not. Adding "--" to the beginning converts the TRUE values to 1 and the FALSE values to 0. The next argument does the same thing, but for a different range of cells and for the value "Meets". Lastly, the SUMPRODUCT function multiplies each position in the first array with the same position in the second array then adds up the result. Here is an example:

Array 1 = {0;1;1;1;0}
Array 2 = {0;0;1;0;0}
Product Array = {0;0;1;0;0}
Sum Result = 1

The SUMPRODUCT function isn't quite as elegant as the COUNTIFS function, but it gets the job done.

tags:
microsoft, excel
Excel'ling said:
 
This was perfect! It absolutely worked like a charm. And to hell with it not being as elegant! This looks like a lot more work, hence more billable hours... :)
 
posted 466 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Nithin said:
 
Hi ,
well the above code does not seem to support text characters in boththe conditions .
 
posted 311 days ago
Add Comment Reply to: this comment OR this thread
 
Atroson said:
 
This worked wonderfully, a functional workaround for Countifs to work with Excel 2000, 2002 and 2003. Thank you for explaining it so thoroughly!
 
posted 382 days ago
Add Comment Reply to: this comment OR this thread
 
Sara said:
 
Exactly what I was looking for; Worked very well; Thanks
 
posted 347 days ago
Add Comment Reply to: this comment OR this thread
 
Ernie said:
 
I echo what the others said. This may be a bit combersome but it does the job. Thank you.
 
posted 340 days ago
Add Comment Reply to: this comment OR this thread
 
Dereck said:
 
Thanks a lot, i was doing a rather complex analysis when i realized my client doesn't have Excel 2007, this saved me a lot of trouble.
 
posted 339 days ago
Add Comment Reply to: this comment OR this thread
 
Nithin said:
 
=sumproduct(--(D21:D65536,"BOA_MBNA"),--(E21:E65536,"PL"))

this doesnot seem to work in excell 2003 , need help really bad !!!
 
posted 311 days ago
View Replies (3) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Windy said:
 
Did you find a way to do this with text entries? I need to do this and I only have Office 2003. I need to check for all cells that contain a certain text and also have a field with a date in a particular quarter.
 
posted 303 days ago
Add Comment Reply to: this comment OR this thread
 
Nithin said:
 
Yup it seems to be working Great !!!!

=sumproduct(--(D21:D65536,="Text"),--(E21:E65536,=Date))

 
posted 303 days ago
Add Comment Reply to: this comment OR this thread
 
Martin said:
 
try this array formula for two text entries
=sum((A:A="text1")*(B:B="text2"))
!!!! remember to press ctrl shift enter to make sure the array formula works as intended !!!
 
posted 297 days ago
Add Comment Reply to: this comment OR this thread
 
Allan said:
 
Hi,

This is a great thread but unfortunately Im really stuck. I cant understand why it wont work for me.

I have 2 colums
n with the values
{1,2,3,1,2,3,1,2,3}
o with the values
{1,2,1,2,1,2,1,2,1}

Im trying to find count for every 1 in column n how many corresponding 1s are in column o (the answer should be 2)
It wont resolve for me, the following is the function Im using

=SUMPRODUCT(--(TestCases!$N:$N="1"),--(TestCases!$O:$O="1"))

Test Cases is the tab I have it in. I also tried it without the inverted commas around the 1s but that isnt helping either.

PLEASE HELP! Im really stuck :(
 
posted 221 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Excel'ling said:
 
OK, I found the error here. The post above is a little misleading. If you specify a whole column as your target cells it will break the formula. I can't think of a reason that it would do this, but this is what happens. Also, you don't need the "" around the input value if it's a number.

Try your formula like this instead and it should work:
=SUMPRODUCT(--(TestCases!$N1:$N9=1),--(TestCases!$O1:$O9=1))
 
posted 220 days ago
Add Comment Reply to: this comment OR this thread
 

Search