# Count Names Based on Three Criteria

#### BYates123

##### New Member
I need to count names based on three different criteria. Column A lists employee names, Column B lists the month, Column C lists the year. I need to count the number of names that occur each month for every year, but each name can only be counted once. For example, I need to know how many names are listed under March, 2012, but I can only count that name if it is not used in January or February of 2012. This criteria for unique names only applies for the year, so if a name is listed only once in 2012 and 2013 then it is still unique for each respective year.

I tried the following use of "countifs", but wasn't sure how to create a code to satisfy the third criteria, which is that the name is not repeated previously in the calendar year. I feel like it shouldn't be too difficult but I can't figure it out!

Code:
``<code>=countifs(C:C,"2012",B:B,"Mar",A:A...????</code>``

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Have you thought of doing a pivot table and viewing the data like this?

There are a number of ways
You could have Years and Months on the left and names across the top. With say a count of Names as your values and then do a =COUNTIF(C6:H6,">"&1)

 Count of Name Column Labels Row Labels BOP HXS KGZ RKM VPH XRL Grand Total 2012 2 2 1 1 1 7 Jan 2 1 3 Feb 1 1 2 Mar 1 1 2 2013 2 1 1 4 Jan 1 1 2 Feb 1 1 Mar 1 1 Grand Total 2 3 2 1 2 1 11

<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

Last edited:
Have you thought of doing a pivot table and viewing the data like this?

There are a number of ways
You could have Years and Months on the left and names across the top. With say a count of Names as your values and then do a =COUNTIF(C6:H6,">"&1)

 Count of Name Column Labels Row Labels BOP HXS KGZ RKM VPH XRL Grand Total 2012 2 2 1 1 1 7 Jan 2 1 3 Feb 1 1 2 Mar 1 1 2 2013 2 1 1 4 Jan 1 1 2 Feb 1 1 Mar 1 1 Grand Total 2 3 2 1 2 1 11

<tbody>
</tbody>

Sorry that countif should be =COUNTIF(b6:G6,">"&0)

Last edited:

Replies
3
Views
201
Replies
7
Views
603
Replies
21
Views
501
Replies
4
Views
149
Replies
0
Views
269

1,203,752
Messages
6,057,150
Members
444,908
Latest member
Jayrey

### 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