unique count with criteria

nsimha

New Member
Joined
Mar 22, 2014
Messages
18
Hi,

I did a search before resorting to post this query but unfortunately the results from the search (sumproduct / frequency / countif) seemed to be confusing to me.. and therefore this post

I have sample monthly data for sales in one sheet as below..

MonthInv No.
Apr-13743
Apr-13759
Apr-13760
Apr-13760
May-13777
May-13822
May-13823
May-13823
May-13825
Jun-131087
Jun-131088
Jun-131092
Jun-131027
Jun-131091
Jun-131124
Jun-131124
Jun-131133
Jun-131133
Jun-131135
Jul-131266
Jul-131265
Jul-131265
Jul-131265
Jul-131347

<tbody>
</tbody>

I have one more summary sheet which has a small table with Month in col A & Unique count in col B.. I need to arrive at the unique count of invoice nos against each month with a formula in the unique count column

Month
Unique Inv Count
Apr-133
May-134
Jun-138
Jul-133

<tbody>
</tbody>

Can somebody help?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Let A:B house the data, D:E the unique count processing...

E2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$B$25<>"",
  IF($A$2:$A$25-DAY($A$2:$A$25)+1=D2-DAY(D2)+1,
  MATCH($B$2:$B$25,$B$2:$B$25,0))),
  ROW($B$2:$B$25)-ROW($B$2)+1),1))

Also...
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$B$25<>"",
  IF($A$2:$A$25=D2,
  MATCH($B$2:$B$25,$B$2:$B$25,0))),
  ROW($B$2:$B$25)-ROW($B$2)+1),1))
if the dates involved are all first day dates like 1-Apr-13.
 
Upvote 0
Works perfectly. Thanks.
it will take a bit of time though for me just understand how this worked.. Thanks again

Let A:B house the data, D:E the unique count processing...

E2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$B$25<>"",
  IF($A$2:$A$25-DAY($A$2:$A$25)+1=D2-DAY(D2)+1,
  MATCH($B$2:$B$25,$B$2:$B$25,0))),
  ROW($B$2:$B$25)-ROW($B$2)+1),1))

Also...
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$B$25<>"",
  IF($A$2:$A$25=D2,
  MATCH($B$2:$B$25,$B$2:$B$25,0))),
  ROW($B$2:$B$25)-ROW($B$2)+1),1))
if the dates involved are all first day dates like 1-Apr-13.
 
Upvote 0

Forum statistics

Threads
1,215,537
Messages
6,125,386
Members
449,221
Latest member
DFCarter

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