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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

jobb

Board Regular
Joined
Apr 24, 2003
Messages
78
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]
 

ddeldeb

New Member
Joined
Nov 17, 2002
Messages
29
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.
 

PeterCol

New Member
Joined
Jun 26, 2003
Messages
18
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,101
Messages
5,768,100
Members
425,453
Latest member
bince

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
Top