Counting Formula

RTB3001

Board Regular
Joined
Nov 26, 2004
Messages
76
Hi everyone,

Hope you can help.

Column A has a set of labels, for example AAA, BBB, CCC, DDD, EEE, FFF
These labels can be repeated many times.

Column B has another set of labels 1TTT, 2UUU, 3WWW, 4XXX, 5YYY.
Again these can be repeated.

What I want to know if how many uniques column A has in reference to column B.

i.e.

AAA 1TTT
AAA 1TTT
AAA 1TTT
AAA 2UUU
AAA 2UUU
AAA 5YYY

BBB 3WWW
BBB 3WWW
BBB 4XXX

AAA therefore has 3 uniques
BBB therefore has 2 uniques

Thanks in advance as always, Ross.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Book2
ABCDEF
1Col ACol BAAA3
2AAA1TTTBBB2
3AAA1TTT
4AAA1TTT
5AAA2UUU
6AAA2UUU
7AAA5YYY
8
9BBB3WWW
10BBB3WWW
11BBB4XXX
12
Sheet1


Formula in E1: =COUNT(1/FREQUENCY(IF($A$2:$A$11=D1,IF($B$2:$B$11<>"",MATCH($B$2:$B$11,$B$2:$B$11,0))),ROW($A$2:$A$11)-ROW($A$2)+1))

confirmed with CTRL+SHIFT+ENTER and copied down.

Adjust ranges to suit and re-confirm with CSE key combo.
 
Upvote 0
Putting the values you want to check in Column C:
Formula in D1:
=SUM(IF($A$1:$A$1000=C1,1/COUNTIF($B$1:$B$1000,$B$1:$B$1000)))

Confirm with CTRL-SHIFT-ENTER rather than just Enter

Copy down.
Book1
ABCD
1AAA1TTTAAA3
2AAA1TTTBBB2
3AAA1TTT
4AAA2UUU
5AAA2UUU
6AAA5YYY
7
8BBB3WWW
9BBB3WWW
10BBB4XXX
Sheet1
 
Upvote 0
You can also try :
Select your list
Data-Filter-Advanced Filter
Check unique records only
OK

Data - subtotals - Use function Count
OK
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,294
Members
449,149
Latest member
mwdbActuary

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