Count unique value comparing multiple coloumn

pratheesh1983

Board Regular
Joined
Aug 13, 2015
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a table which has two columns, column A & B - Column A have "section" and B consists of User Name. In column B user column the entries will be repeating. I need a formula which will give me the count of unique value base on the section (ref. Table 2) eg. for Section A = no. of unique value is 4. Could any one please assist me to formulate formula for this?




Table 1

SECTIONUSER
ARAMESH T K
ARAMESH T K
AARUN M
AARUN M
AMATHEW W
AMATHEW P
BPAUL PK
BPAUL PK
BTOM LG
CTOM LG
CASHISH N
CPARTRICK P

<colgroup><col><col></colgroup><tbody>
</tbody>

Table 2

UNIQUE VALUE
SECTIONCOUNT
A4
B2
C3

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try


A
B
C
D
E
1
SECTION​
USER​
UNIQUE VALUE​
2
A​
RAMESH T K​
SECTION​
COUNT​
3
A​
RAMESH T K​
A​
4​
4
A​
ARUN M​
B​
2​
5
A​
ARUN M​
C​
3​
6
A​
MATHEW W​
7
A​
MATHEW P​
8
B​
PAUL PK​
9
B​
PAUL PK​
10
B​
TOM LG​
11
C​
TOM LG​
12
C​
ASHISH N​
13
C​
PARTRICK P​
14

Array formula in E3 copied down
=SUM(IF(FREQUENCY(IF(A$2:A$13=D3,MATCH(B$2:B$13,B$2:B$13,0)),ROW(B$2:B$13)-ROW(B$2)+1),1))
confirmed with Ctrl+Shift+Enter, not just Enter

M.
 
Upvote 0
Another option with "regular" formula


<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:98.85px;" /><col style="width:19.96px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="background-color:#92d050; font-weight:bold; text-align:center; ">SECTION</td><td style="background-color:#92d050; font-weight:bold; text-align:center; ">USER</td><td style="background-color:#92d050; font-weight:bold; "> </td><td style="background-color:#92d050; font-weight:bold; text-align:center; ">SECTION</td><td style="background-color:#92d050; font-weight:bold; text-align:center; ">UNIQUE</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >A</td><td >RAMESH T K</td><td > </td><td style="text-align:center; ">A</td><td style="text-align:right; ">4</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td >A</td><td >RAMESH T K</td><td > </td><td style="text-align:center; ">B</td><td style="text-align:right; ">2</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td >A</td><td >ARUN M</td><td > </td><td style="text-align:center; ">C</td><td style="text-align:right; ">3</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td >A</td><td >ARUN M</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td >A</td><td >MATHEW W</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td >A</td><td >MATHEW P</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td >B</td><td >PAUL PK</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td >B</td><td >PAUL PK</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td >B</td><td >TOM LG</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td >C</td><td >TOM LG</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td >C</td><td >ASHISH N</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td >C</td><td >PARTRICK P</td><td > </td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Formeln der Tabelle</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Zelle</td><td >Formel</td></tr><tr><td >E2</td><td >=SUMPRODUCT(($A$2:$A$13=D2)*(MATCH($A$2:$A$13&$B$2:$B$13, $A$2:$A$13&$B$2:$B$13,0)=ROW($B$2:$B$13)-1))</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,684
Members
449,048
Latest member
81jamesacct

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