CountIf text strings per month per year

ShelleyBelly

New Member
Joined
Mar 2, 2011
Messages
44
Hi,

I'm totally new to posting but have found MrExcel a life saver on more than one occasion.

I would like to count the number of times a name appears given month and year. For example, Mark appears twice in july in 2010.

My spreadsheet is as follows:

A B
21-Jul-10 Mark
29-Jul-10 Pippa, Gerri, Mark, Lee, Ade
30-Jul-10 Pippa, Gerri, Nicola, Lee, Ade
3-Aug-10 Mark
4-Aug-10 Mark
5-Aug-10 Pippa, Ade, Gerri, Nicola, Jules
6-Aug-10 Pippa, Ade, Gerri, Nicola, Jules


I have already got the =COUNTIFS(B:B,"*" & D1 & "*") where D1 is the name. This works but obviously doesn't discriminate between months and years.

I've tried

=SUMPRODUCT(--(B:B="*" & Mark & "*"),--(MONTH(A:A)=8),--(YEAR(A:A)=2010))

But get #Name? . I'm not so sure the SumProduct is the way forward either.

Anybody any ideas, I have spent plenty of time looking through forums but haven't come across the right answer.

Many Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try,

=COUNTIFS(A:A,">="&DATE(2010,7,1),A:A,"<="&DATE(2010,7,31),B:B,"*"&D1&"*")

Where D1 is the name.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top