Count all unique occurrences given a criteria

nm1234

New Member
Joined
Aug 29, 2014
Messages
1
Given the data set:

Name Date Amount
Steve Jan 1 $5
Phil Jan 1 $7
Phil Feb 1 $5
John Feb 1 $3

I want to determine new customers on a monthly basis. So In January I should have 2 new customers Steve and Phil but in February I should only have one new customer John.

January February
2 1

I've tried using a frequency match array formula but the problem is when I narrow the data set by month, the match statement is only looking at February rows so it thinks Phil is a unique (new) customer.

Any help is appreciated!!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
First, make sure that all dates are true date values. Then try the following...

A1:C5

[TABLE="width: 144"]
<TBODY>[TR]
[TD="class: xl63, width: 64, bgcolor: transparent"]Name
[/TD]
[TD="class: xl63, width: 64, bgcolor: transparent"]Date
[/TD]
[TD="class: xl63, width: 64, bgcolor: transparent"]Amount
[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]Steve
[/TD]
[TD="class: xl64, bgcolor: transparent, align: right"]01-Jan
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]$5
[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]Phil
[/TD]
[TD="class: xl64, bgcolor: transparent, align: right"]01-Jan
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]$7
[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]Phil
[/TD]
[TD="class: xl64, bgcolor: transparent, align: right"]01-Feb
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]$5
[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]John
[/TD]
[TD="class: xl64, bgcolor: transparent, align: right"]01-Feb
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]$3
[/TD]
[/TR]
</TBODY>[/TABLE]

E1:F1

[TABLE="width: 96"]
<TBODY>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent, align: right"]01-Jan
[/TD]
[TD="class: xl65, width: 64, bgcolor: transparent, align: right"]01-Feb
[/TD]
[/TR]
</TBODY>[/TABLE]

E2, confirmed with CONTROL+SHIFT+ENTER, copied across:

=SUM(IF(FREQUENCY(IF($B$2:$B$5=E$1,IF(ISNA(MATCH($A$2:$A$5,IF($B$2:$B$5 < E$1,$A$2:$A$5),0)),MATCH("~"&$A$2:$A$5,$A$2:$A$5&"",0))),ROW($A$2:$A$5)-ROW($A$2)+1)>0,1))<E$1,$A$2:$A$5),0)),MATCH("~"&$A$2:$A$5,$A$2:$A$5&"",0))),ROW($A$2:$A$5)-ROW($A$2)+1)>

Hope this helps!</E$1,$A$2:$A$5),0)),MATCH("~"&$A$2:$A$5,$A$2:$A$5&"",0))),ROW($A$2:$A$5)-ROW($A$2)+1)>
 
Upvote 0

Forum statistics

Threads
1,226,453
Messages
6,191,136
Members
453,642
Latest member
jefals

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
Back
Top