Count common value

Boivin12

New Member
Joined
May 17, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I have a list of people and a list of team number.
Every person is attached to one singe team but its name appear several times (I made a simple table).
I would like to know how many people there are in a team (3 in team 1 and 1 in team 2 in my example).
I know it's not a big deal but I can't wrap my head around it...
Person IDTeam number
A1
A1
A1
B2
B2
C1
C1
C1
D1
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I have a list of people and a list of team number.
Every person is attached to one singe team but its name appear several times (I made a simple table).
I would like to know how many people there are in a team (3 in team 1 and 1 in team 2 in my example).
I know it's not a big deal but I can't wrap my head around it...
Person IDTeam number
A1
A1
A1
B2
B2
C1
C1
C1
D1
you can use "Remove Duplicates" with column "Person ID" and "Team number" then used countif in "Team number" to do it
 
Upvote 0
or maybe this could help : by entering your team number in E1, result appears in D2.

Book1
ABCDE
1Person IDTeam numberTeam:2
2A12
3A1
4A1
5B2
6B2
7C1
8C1
9C1
10D4
11E2
12E2
13
Sheet1
Cell Formulas
RangeFormula
D2D2=LET(names,UNIQUE(A2:B12),numbers,CHOOSECOLS(names,2),SUMPRODUCT(--(numbers=E1)))
 
Upvote 0
I should have notified sorry. But, I can't delete duplicate value ( I have to keep my data for other functions) and I would like to have the appearing on a third column, for each row.
A13
A13
A13
B21
B21
C13
C13
D13
 
Upvote 0
How about
Fluff.xlsm
ABC
1
2A13
3A13
4A13
5B21
6B21
7C13
8C13
9D13
Sheet6
Cell Formulas
RangeFormula
C2:C9C2=MAP(B2:B9,LAMBDA(m,ROWS(UNIQUE(FILTER(A2:A100,B2:B100=m)))))
Dynamic array formulas.
 
Upvote 0
How about
Fluff.xlsm
ABC
1
2A13
3A13
4A13
5B21
6B21
7C13
8C13
9D13
Sheet6
Cell Formulas
RangeFormula
C2:C9C2=MAP(B2:B9,LAMBDA(m,ROWS(UNIQUE(FILTER(A2:A100,B2:B100=m)))))
Dynamic array formulas.
It gives me a #SPILL error
 
Upvote 0
Clear all cells in col C & then re-enter the formula in C2 only.
 
Upvote 0
did you try my formula in D2 ?

Cell Formulas
RangeFormula
D2D2=LET(names,UNIQUE(A2:B12),numbers,CHOOSECOLS(names,2),SUMPRODUCT(--(numbers=E1))
 
Upvote 0
did you try my formula in D2 ?

Cell Formulas
RangeFormula
D2D2=LET(names,UNIQUE(A2:B12),numbers,CHOOSECOLS(names,2),SUMPRODUCT(--(numbers=E1))
I need to automatically see the result next to each cell. I can't enter one value after another (I have over 600 teams and 250,000 rows).
 
Upvote 0
sorry, I missed your comment ... clear. then Fluffs should do you well.

cheers
Rob
 
Upvote 0

Forum statistics

Threads
1,217,413
Messages
6,136,474
Members
450,015
Latest member
excel_beta_345User

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