Count Unique values between two dates - if the value has not appeared at all

Cambo99

New Member
Joined
Mar 17, 2014
Messages
7
Hello,

I need to count the unique values of a list between two dates - but only if that particular value has not already appeared. Some context might help.
I have a list of all customer receipts with the data as follows;

Column A: Receipt date
Column B: Customer name
Column C: Receipt amount

I need to know the number of new customer receipts that have been receipted in a particular date range (from cell G7 to cell H7). I can count how many receipts have been made by using the COUNTIFS function, but I have not been able to limit this to new customers only.

My current formula is =COUNTIFS(A:A,">="&G7,A:A,"<="&H7)

I am now stuck with how to add the criteria for unique names / values.

Can someone please help?
Many thanks in anticipation
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($B$2:$B$1000=""),IF($A$2:$A$1000>=G7,IF($A$2:$A$1000<=H7,MATCH($B$2:$B$1000,$B$2:$B$1000,0)))),ROW($B$2:$B$1000)-ROW($B$2)+1),1))
 
Upvote 0
Thank you Aladin for the quick reply. This works great in counting how many unique deposits were received in a particular date range. However is there a way to only return a value if the customer has not already made a deposit?
Probably an example might help the explanation. If someone deposits two lots of money in July and two in August, is it possible to count this only in once in July and not at all in August?
 
Upvote 0
Thank you Aladin for the quick reply. This works great in counting how many unique deposits were received in a particular date range. However is there a way to only return a value if the customer has not already made a deposit?
Probably an example might help the explanation. If someone deposits two lots of money in July and two in August, is it possible to count this only in once in July and not at all in August?

The formula I posted does a unique count between two receipt dates.

It seems you want a monthly unique count of names with first time deposits. Try to post a small sample with the expected output though.
 
Upvote 0
Yes, I really liked the formula that you posted for the unique count between two receipt dates.
A sample of data that I am trying to work with is as follows;

Date Name Amount
12/07/2017 William Cosgrove 81,000.00
14/07/2017 Hugo Bunker 20,000.00
14/07/2017 Mia Bunker 87,000.00
19/07/2017 William Cosgrove 3,000.00
19/07/2017 William Cosgrove 53,000.00
19/07/2017 William Cosgrove 61,000.00
19/07/2017 William Cosgrove 74,000.00
25/07/2017 Charlotte Siede 38,000.00
09/08/2017 William Cosgrove 73,000.00 has already deposited money in July 2017 so needs to be excluded from August 2017 count
10/08/2017 Erin Janssen 2,000.00
15/08/2017 Hugo Bunker 2,000.00 has already deposited money in July 2017 so needs to be excluded from August 2017 count
15/08/2017 Mia Bunker 96,000.00 has already deposited money in July 2017 so needs to be excluded from August 2017 count
30/08/2017 Oliver Wyselaskie 50,000.00
24/08/2017 Stephanie McDermott 85,000.00
05/09/2017 Emily Mirams 27,000.00
19/09/2017 Emily Mirams 54,000.00
27/09/2017 Archie Foy 8,000.00
27/09/2017 Hayley Foy 91,000.00
05/10/2017 Holly Butlin 59,000.00
09/10/2017 Mary Pie 69,000.00
24/10/2017 Erin Janssen 59,000.00
30/10/2017 Skye Mackness 61,000.00

Then the results that I am after would be as follows;
Start Date End Date New Receipts
1/07/2017 31/07/2017 5
1/08/2017 31/08/2017 3
1/09/2017 30/09/2017 3
1/10/2017 31/10/2017 3

I hope that this better explains it - Thank you :)
 
Upvote 0
Row\Col
A​
B​
C​
E​
F​
G​
1​
DateNameAmountStart DateEnd dateNew Receipts
2​
7/12/2017
William Cosgrove
81,000.00​
7/1/2017​
7/31/2017​
4​
3​
7/14/2017
Hugo Bunker
20,000.00​
8/1/2017​
8/31/2017​
3​
4​
7/14/2017
Mia Bunker
87,000.00​
9/1/2017​
9/30/2017​
3​
5​
7/19/2017
William Cosgrove
3,000.00​
10/1/2017​
10/31/2017​
3​
6​
7/19/2017
William Cosgrove
53,000.00​
7​
7/19/2017
William Cosgrove
61,000.00​
8​
7/19/2017
William Cosgrove
74,000.00​
9​
7/25/2017
Charlotte Siede
38,000.00​
10​
8/9/2017
William Cosgrove
73,000.00​
11​
8/10/2017
Erin Janssen
2,000.00​
12​
8/15/2017
Hugo Bunker
2,000.00​
13​
8/15/2017
Mia Bunker
96,000.00​
14​
8/30/2017
Oliver Wyselaskie
50,000.00​
15​
8/24/2017
Stephanie McDermott
85,000.00​
16​
9/5/2017
Emily Mirams
27,000.00​
17​
9/19/2017
Emily Mirams
54,000.00​
18​
9/27/2017
Archie Foy
8,000.00​
19​
9/27/2017
Hayley Foy
91,000.00​
20​
10/5/2017
Holly Butlin
59,000.00​
21​
10/9/2017
Mary Pie
69,000.00​
22​
10/24/2017
Erin Janssen
59,000.00​
23​
10/30/2017
Skye Mackness
61,000.00​

A2:A23 >> Date
B2:B23 >> Name
C2:C23 >> Amount

In G2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF(1-(Name=""),IF(Date-DAY(Date)+1=E2,IF(ISNA(MATCH(Name,IF(Date<E2,Name),0)),MATCH(Name,Name,0)))),ROW(Date)-ROW(INDEX(Date,1,1))+1),1))

Note. The formula does not test the Amount range. The assumption is that Amount is always > 0 if it occurs.
 
Upvote 0
Thank you - your assumption is correct that the formula does not test the amount range as if it occurs it is always > 0.
But is the formula given incomplete?
 
Upvote 0
The formula is only as follows
=SUM(IF(FREQUENCY(IF(1-(Name=""),IF(Date-DAY(Date)+1=E2,IF(ISNA(MATCH(Name,IF(Date
 
Upvote 0
The formula is only as follows
=SUM(IF(FREQUENCY(IF(1-(Name=""),IF(Date-DAY(Date)+1=E2,IF(ISNA(MATCH(Name,IF(Date

I hate html. Period.

The gobbled formula is:

=SUM(IF(FREQUENCY(IF(1-(Name=""),IF(Date-DAY(Date)+1=E2,IF(ISNA(MATCH(Name,IF(Date < E2,Name),0)),MATCH(Name,Name,0)))),ROW(Date)-ROW(INDEX(Date,1,1))+1),1))

You need to confirm the formula with control+shift+enter, not just enter.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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