[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Count Unique Coustomers in excel by Month

Posted on 2012-12-29
4
Medium Priority
?
350 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

650 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