# COUNTIF with muliple criteria

#### jdangle

##### New Member
My original worksheet only counted 1 criteria (how many issues were closed each month (column defined as Year_Month_Closed)).

my equation before was simply COUNTIF(Year_Month_Closed, "2003 Jan") which i wrote in every cell all the way up to "2005 Dec".

Instead of just having one total per month, i have 20 people (defined as NAMES) down the left hand column and want to count how many each person closed each month. I am pretty sure you cant use an AND statement within a COUNTIF. Anybody have any suggestions to help me out?

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### acw

##### MrExcel MVP
Hi

Try the SUMPRODUCT

=sumproduct(--(year_month_closed = "2003 Jan"),--(names = "your name here"))

Tony

#### jdangle

##### New Member
The sumproduct didnt work very well. It says "a value used in the formula is of the wrong data type". after clicking on show calculation steps it shows that the first criteria (month closed) returns a 1 or 0 and the second criteria (names) returns a true or false. Why is this? Any other suggestions?

#### Zack Barresse

##### MrExcel MVP
Your ranges must be of equal size. I'm not sure that they are here.

#### jdangle

##### New Member
That was it!!! My range for names was 2 cells longer than my range for year_month_closed.

Thanks for the help!!

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,059
Messages
5,835,166
Members
430,343
Latest member
t0m_c

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back