Solved

Count Unique Coustomers in excel by Month

Posted on 2012-12-29
4
298 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
4 Comments
 
LVL 10

Expert Comment

by:schaps
Comment Utility
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
Comment Utility
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 500 total points
Comment Utility
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 92

Expert Comment

by:Patrick Matthews
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now