Counting Unique Entries within an Array calculation

Vance36

New Member
Joined
Jul 21, 2011
Messages
2
Hey Guys,

I've been getting frustrated with this all day & I am convinced there must be a simple solution. I am working with several columns in a spreadsheet & I require certain criteria in several columns to force results onto a summary sheet. I have managed to complete this task with Array formulas but as soon as I attach the Frequencey formula to the Array it falls down. I'll attempt to explain with some random data below:


A B
1 Agent Name Ref
2 Jon Todd 123456
3 Jack Jones 45
4 Jon Todd 123456
5 Jon Todd 21
6 Jim Reeves 123
7 Jim Reeves 123

Ok so I want to see each name only once with a count of the unique Ref's. Like this:

Jon Todd = 2 '(123456 & 21)
Jack Jones = 1 '(45)
Jim Reeves = 1 '(123)

So my array will allow me to show the agent name but will only sum up the ref's it count see the unique values. I could do this a number of ways such as with advanced filters but then I can't work it into the array. It has to be part of the array as I can't change the source data in any way. The frequency formula works but not within an array.

My task is 99% done & this final part is frustrating me no end.

Any views on this would be greatfully received.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
If your unique names are in column C starts from C2 put this in D2

=COUNT(1/FREQUENCY(IF($A$2:$A$16=C2,MATCH($B$2:$B$16,$B$2:$B$16,0)),ROW($A$2:$A$16)-ROW(AA2)+1))

Confirm C+S+E ,copy down.
 
Upvote 0
Hey Guys,

I've been getting frustrated with this all day & I am convinced there must be a simple solution. I am working with several columns in a spreadsheet & I require certain criteria in several columns to force results onto a summary sheet. I have managed to complete this task with Array formulas but as soon as I attach the Frequencey formula to the Array it falls down. I'll attempt to explain with some random data below:


A B
1 Agent Name Ref
2 Jon Todd 123456
3 Jack Jones 45
4 Jon Todd 123456
5 Jon Todd 21
6 Jim Reeves 123
7 Jim Reeves 123

Ok so I want to see each name only once with a count of the unique Ref's. Like this:

Jon Todd = 2 '(123456 & 21)
Jack Jones = 1 '(45)
Jim Reeves = 1 '(123)

So my array will allow me to show the agent name but will only sum up the ref's it count see the unique values. I could do this a number of ways such as with advanced filters but then I can't work it into the array. It has to be part of the array as I can't change the source data in any way. The frequency formula works but not within an array.

My task is 99% done & this final part is frustrating me no end.

Any views on this would be greatfully received.
If the "REF" really is a number...

Book1
ABCDE
2Jon Todd123456_Jon Todd2
3Jack Jones45_Jack Jones1
4Jon Todd123456_Jim Reeves1
5Jon Todd21___
6Jim Reeves123___
7Jim Reeves123___
Sheet1

This array formula** entered in E2 and copied down:

=SUM(IF(FREQUENCY(IF(A$2:A$7=D2,B$2:B$7),B$2:B$7),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.
 
Upvote 0
Using the example posted by T. Valko (Biff)
This regular formula (no C+S+E needed) counts the unique combinations of the referenced name and the number
Code:
E2: =COUNT(INDEX(1/((A$2:A$7=D2)*FREQUENCY((A$2:A$7=D2)*B$2:B$7,B$2:B$7)),0))
Copy that formula down as far as you need.

Is that something you can work with?
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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