Formula Needed - Count

baggarwal

Well-known Member
Joined
Jul 10, 2002
Messages
591
Hi All:

I have the data set like this:
Grp EnvNo EnvNo Count
1101010 1101011 BB
1101010 1101012 BB
1101010 1101013 BB
1101010 1101014 BB
1101010 1101015 BB
1101020 1101021 BB


I want to count the number of BB's at the Group Envelope ID level so I need a formula that will go into Column A and count the BB for each unique group envelope ID. So in this set I would want to see a count of 2 as oppose to 6. Can someone please tell me how this can be done.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
If your data are in columns A-C:
=SUM(IF(FREQUENCY(IF(C$2:C$12="BB",A$2:A$12),A$2:A$12),1))

Array formula confirm (CTR+SHIFT+ENTER)
 
Upvote 0
In case you have text numbers as Grp...

Control+shift+enter, not just enter:
Code:
=SUM(IF(FREQUENCY(IF(A2:A7<>"",
    IF(C2:C7="BB", MATCH("~"&A2:A7,A2:A7&"",0))),
      ROW(A2:A7)-ROW(A2)+1),1))
 
Upvote 0
Hi All:

I have the data set like this:
Grp EnvNo EnvNo Count
1101010 1101011 BB
1101010 1101012 BB
1101010 1101013 BB
1101010 1101014 BB
1101010 1101015 BB
1101020 1101021 BB


I want to count the number of BB's at the Group Envelope ID level so I need a formula that will go into Column A and count the BB for each unique group envelope ID. So in this set I would want to see a count of 2 as oppose to 6. Can someone please tell me how this can be done.
One way...

Array entered**:

=SUM(IF(FREQUENCY(IF(C2:C7="BB",MATCH(A2:A7,A2:A7,0)),ROW(A2:A7)-ROW(A2)+1),1))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Assumes no empty cells within the data range of column A.
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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