INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Excel - count only distinct IDs per month

Excel - count only distinct IDs per month

(OP)
Hello - I'm trying to count distinct ids per month. but it is not working for me.

CODE

worksheet1
    A       B                  C
1   ID      tempDate           DateValidation
2   12      11/12/2017         11/01/2017
3   14      12/23/2017         12/01/2017
4   16      11/17/2017         01/01/2017
5   20      11/11/2017
6   12      11/16/2017
7   16      11/01/2017
8   14      12/01/2017 

what I'm trying to do is get the count of distinct ID per month. looking for the following output:
Nov 2017 3
Dec 2017 1
Jan 2018 0

so far i have:

CODE

=SUM(IF(FREQUENCY(A2:A8, A2:A8)>0,1)) 

it gives me 4. that is right but now i need it monthly.
as following:
Nov 2017 3
Dec 2017 1
Jan 2018 0

i also tried the following but i'm confused how to integrate distinct ID win it.

CODE

=IFERROR(COUNTIFS($B$2:$B$8,">="&$C$2, $B$2:$B$8,"<="&EOMONTH($C$2,0)),"") 

Any help is appreciated. Thanks.

RE: Excel - count only distinct IDs per month

"count distinct ids per month" would it help to have a (helper) column with just the Month?

...     D
... =MONTH(B2)
 


---- Andy

There is a great need for a sarcasm font.

RE: Excel - count only distinct IDs per month

(OP)
tempDate is going to have 12/01/2018 onward dates so just month helper would have incorrect data, so I need month and year as well.

Thanks.

RE: Excel - count only distinct IDs per month

Using Named Ranges based on column headings...

ID	tempDate	        	12	14	16	20	Count
12	11/12/2017	11/1/2017	2	0	2	1	3
14	12/23/2017	12/1/2017	0	2	0	0	1
16	11/17/2017	1/1/2018	0	0	0	0	0
20	11/11/2017	2/1/2018					
12	11/16/2017						
16	11/1/2017						
14	12/1/2017						
 

=SUMPRODUCT((tempDate>=$C2)*(tempDate<$C3)*(ID=D$1))
=SUMPRODUCT(--(D2:G2>0))



Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Excel - count only distinct IDs per month

So your original statement: "I'm trying to count distinct ids per month. but ..." was not correct, since you said later: "I need month and year as well." sad


---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close