Count unique instances of text between two dates

B5rocksass

Board Regular
Joined
Jan 10, 2017
Messages
56
Office Version
  1. 2016
Platform
  1. Windows
Please note that my skills are few and far between. I have tried the following formula with CTRL+SHIFT+ENTER but it returns zero. I need to find the unique # of customers that purchased material each month. Here is the formula that failed: =SUMPRODUCT(IF((Date<h15)*(date>=H14),1/COUNTIFS(Customer_Name,"<="&H15,Date,">="&H14,Customer_Name,Customer_Name),0))

I would like to put this in a table that shows the calendar year, Jan-16 to Jan -17. So it looks like:

[TABLE="class: grid, width: 300, align: left"]
<tbody>[TR]
[TD]DATE
[/TD]
[TD]# OF CUSTOMERS
[/TD]
[/TR]
[TR]
[TD]JAN-16
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]FEB-16
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]MAR-16
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]


Starting from a table that looks similar to this:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]DATE
[/TD]
[TD]CUSTOMER NAME
[/TD]
[/TR]
[TR]
[TD]JAN-16
[/TD]
[TD]CUSTOMER_NAME_01
[/TD]
[/TR]
[TR]
[TD]JAN-16
[/TD]
[TD]CUSTOMER_NAME_01
[/TD]
[/TR]
[TR]
[TD]JAN-16
[/TD]
[TD]CUSTOMER_NAME_02
[/TD]
[/TR]
[TR]
[TD]JAN-16
[/TD]
[TD]CUSTOMER_NAME_03
[/TD]
[/TR]
[TR]
[TD]FEB-16
[/TD]
[TD]CUSTOMER_NAME_01
[/TD]
[/TR]
[TR]
[TD]FEB-16
[/TD]
[TD]CUSTOMER_NAME_02
[/TD]
[/TR]
[TR]
[TD]FEB-16
[/TD]
[TD]CUSTOMER_NAME_02
[/TD]
[/TR]
[TR]
[TD]MAR-16
[/TD]
[TD]CUSTOMER_NAME_01
[/TD]
[/TR]
[TR]
[TD]MAR-16
[/TD]
[TD]CUSTOMER_NAME_01
[/TD]
[/TR]
[TR]
[TD]MAR-16
[/TD]
[TD]CUSTOMER_NAME_03
[/TD]
[/TR]
[TR]
[TD]MAR-16
[/TD]
[TD]CUSTOMER_NAME_03
[/TD]
[/TR]
</tbody>[/TABLE]
</h15)*(date>
 
If you data range in A:B convert into an Excel table, in E2 control+shift+enter, not just enter, and copy down:

=IF($D2="","",SUM(IF(FREQUENCY(IF(1-(Table1[CUSTOMER NAME]=""),IF(Table1[DATE]=$D2,MATCH(Table1[CUSTOMER NAME],$B$2:$B$12,0))),ROW(Table1[CUSTOMER NAME])-ROW(INDEX(Table1[CUSTOMER NAME],1,1))+1),1)))
 
Upvote 0
She wants to switch the report so that the customer name shows first in the list and then the date. I adjusted the formula to show column A is now B and vice versa but now its not working again. Please help !!!
 
Upvote 0
I think the problem is coming from the months. When I copied the table excel saw Jan-16 as 1/16/2016 instead of the month of January and including all dates within that time frame.
 
Upvote 0
She wants to switch the report so that the customer name shows first in the list and then the date. I adjusted the formula to show column A is now B and vice versa but now its not working again. Please help !!!

I think the problem is coming from the months. When I copied the table excel saw Jan-16 as 1/16/2016 instead of the month of January and including all dates within that time frame.

The dates are expected to be the first day dates, i.e. 1-Jan-16, 1-Feb-2016, etc.
 
Upvote 0

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