?
Solved

Count Unique Coustomers in excel by Month

Posted on 2012-12-29
4
Medium Priority
?
343 Views
Last Modified: 2012-12-29
I have a table with the following fields

CoustomerID   Date  


one coustomer may order 50 things in one month. I want to be able to count the number of coustomer ordering per month.

Any help?
sample.xlsx
0
Comment
Question by:the_Apple
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 10

Expert Comment

by:schaps
ID: 38729517
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38729569
Try this formula

=SUM(IF(FREQUENCY(IF(TEXT(B2:B2628,"MMMYY")=$D$2,MATCH(A2:A2628,A2:A2628,0),""), IF(LEN(A2:A2628)>0,MATCH(A2:A2628,A2:A2628,0),""))>0,1))

where cell D2 should contain a month text in the form of "JUL11"
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 38729580
Edit: I missed Saqib's suggestion, posted while I was composing this - my suggestion is very similar.....

If you put the first of each month in F2 down then this "array formula" in G2 will give a "distinct count" of customers for that month

=SUM(IF(FREQUENCY(IF(B$2:B$3000-DAY(B$2:B$3000)+1=F2,MATCH(A$2:A$3000,A$2:A$3000,0)),ROW(B$2:B$3000)-ROW(B$2)+1),1))

confirmed with CTRL+SHIFT+ENTER and copied down

see attached

Note: you have some dates that I assume are incorrect, e.g. one in 2020, one in 2070

regards, barry
distinct-count.xlsx
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 38729590
To get a count of distinct customers by month:

1) In C1 of your original worksheet, add a label such as Unique Customers

2) In C2, add this formula...
=1/SUMPRODUCT(($A$2:$A$2628=A2)*(TEXT($B$2:$B$2628,"yyyy-mm")=TEXT(B2,"yyyy-mm")))
then copy that down through C2628

3) Create a PivotTable, with ApptDate as the row field, and (sum of) Unique Customers as the data field

4) Rightclick one of the dates in your PivotTable, and select Group from the popup menu.  Group your dates by year and month

Please see the attached sample file.

Q-27980493.xlsx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question