Counting unique values occouring in a month

PeterCol

New Member
Joined
Jun 26, 2003
Messages
18
I have a table recording contacts and date contacted over a period of years. I wish to count the number of unique contacts per month so that regardless of whether they have been in contact once or ten times in that month they are counted only once per month. Ideally I would like to do this with a single query if it is possible.

Thanks
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
how about 2 queries?

first query:

calculated fields

GROUP BY
Year: DatePart("yyyy",[Date])
GROUP BY
Month: DatePart("m",[Date])
GROUP BY
[CONTACT]

second query
(based on first query)
GROUP BY
[YEAR]
GROUP BY
[MONTH]
COUNT
[CONTACT]
 
Upvote 0
You could also try a SELECT Distinct(contacts), from......
But just the slightest difference in a record will make it distinct so you need to be a little carefull on what fields you use.
 
Upvote 0
Yes the 2 queries work thanks. Just not as tidy as one and I need to repeat the queries for numerous other fields.

thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

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