I need to count the number of dates that show up in a month in a range, based on the associated name

Hammer21

New Member
Joined
Mar 25, 2010
Messages
22
Hi everyone, its been ages since ive been able to post, but it feels good to be back. I hope everyone is well.

So, I have a small request that for some reason I just cant seem to figure out. I need to have excel do a lookup and countif, or some version of those. I have pasted a view of what I am trying to accomplish below, though of course I just did a manual plug and I want to automate with some type of a formula what is shown in the orange cells. Basically I have a list of names and various dates over the course of three months. I need to find a way to lookup the name and then count a date if it falls within a given month. If it lands on any day in that month I want it to be counted. Any help that anyone can provide would be greatly appreciated.

Thanks!

[TABLE="width: 496"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]G
[/TD]
[/TR]
[TR]
[TD="align: right"]1
[/TD]
[TD][/TD]
[TD="align: center"]Sep-18
[/TD]
[TD="align: center"]Nov-18
[/TD]
[TD="align: center"]Dec-18
[/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]9/14/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]2
[/TD]
[TD="align: center"]Smith
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]1
[/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]9/22/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]3
[/TD]
[TD="align: center"]Jones
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]1
[/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/5/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/12/2017
[/TD]
[/TR]
[TR]
[TD="align: right"]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/12/2017
[/TD]
[/TR]
[TR]
[TD="align: right"]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/12/2017
[/TD]
[/TR]
[TR]
[TD="align: right"]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/12/2017
[/TD]
[/TR]
[TR]
[TD="align: right"]8
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Smith
[/TD]
[TD="align: right"]12/12/2017
[/TD]
[/TR]
[TR]
[TD="align: right"]9
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jones
[/TD]
[TD="align: right"]11/2/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jones
[/TD]
[TD="align: right"]11/1/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]11
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jones
[/TD]
[TD="align: right"]12/11/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jones
[/TD]
[TD="align: right"]9/11/2018
[/TD]
[/TR]
[TR]
[TD="align: right"]13
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jones
[/TD]
[TD="align: right"]11/20/2018
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Assuming that Sep-18 is the display form of 2018-09-01, i.e. a first day date...

In B2 enter, copy across to D2, and down:

=SUMPRODUCT(--($F$1:$F$13=$A2),--($G$2:$G$13-DAY($G$2:$G$13)+1=B$1))
 
Upvote 0
Here's an alternative.
Excel Workbook
ABCDEFG
118-Sep18-Nov18-DecSmith9/14/2018
2Smith201Smith9/22/2018
3Jones131Smith12/5/2018
4Smith12/12/2017
5Smith12/12/2017
6Smith12/12/2017
7Smith12/12/2017
8Smith12/12/2017
9Jones11/2/2018
10Jones11/1/2018
11Jones12/11/2018
12Jones9/11/2018
13Jones11/20/2018
Sheet4
 
Upvote 0
Hi!

Another small modification in the suggestion until now:

=SUMPRODUCT(--($F$1:$F$13=$A2),--(--TEXT($G$1:$G$13,"m/yyyy")=B$1))

Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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