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!

A
B
C
D
E
F
G
1
Sep-18
Nov-18
Dec-18
Smith
9/14/2018
2
Smith
2
0
1
Smith
9/22/2018
3
Jones
1
3
1
Smith
12/5/2018
4
Smith
12/12/2017
5
Smith
12/12/2017
6
Smith
12/12/2017
7
Smith
12/12/2017
8
Smith
12/12/2017
9
Jones
11/2/2018
10
Jones
11/1/2018
11
Jones
12/11/2018
12
Jones
9/11/2018
13
Jones
11/20/2018

<tbody>
</tbody>
 

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.
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,214,583
Messages
6,120,383
Members
448,955
Latest member
BatCoder

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