ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   COUNTIF or SUMPRODUCT counting multiple criteria (https://www.excelbanter.com/excel-worksheet-functions/28639-re-countif-sumproduct-counting-multiple-criteria.html)

Peo Sjoblom

COUNTIF or SUMPRODUCT counting multiple criteria
 
You can not use the whole column so you need to specify the range

=SUMPRODUCT(--('Attendance'!C2:C1000="Attorney"),--('Attendance'!D2:D1000="atlanta"))

a good idea would be to replace the hard coded names (attorney and atlanta)
with cell references, that way you don't have to edit the formula if the
criteria is changed

Regards,

Peo Sjoblom

"Kim" wrote:

I want to count the number of entries that have "attorney" in column C AND
"atlanta" in column D. I only want to count the entries that meet both
criteria (not one OR the other). I have tried numerous formulas usually get
an error #NUM!

Here is what I have tried.
=SUMPRODUCT((Attendance!C:C="Attorney")*(Attendanc e!D:D="Atlanta"))
=COUNTIF(Attendance!C:C, {"Attorney","Atlanta"})
=SUMPRODUCT(--(Attendance!C:C="Attorney"),--(Attendance!D:D="Atlanta"))

Any suggestions? Thank you.



All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com