Distinct count with lookup

carlidee

New Member
Joined
Sep 15, 2020
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have one tab with raw data and I'm looking to create an additional summary tab in the file that creates a distinct count of 'cases' by name

Thank you for your help,
Carli

Example:

Tab 1:
Table with raw data
NameCase
Chip JonesABC1
Chip JonesABC1
Chip JonesDEF2
Sam SmithGHI3
Sam SmithGHI3
Tim SandersJKL4
Tim SandersMNO5
Tim SandersMNO5
Tim SandersPQR6

Tab 2: Summary, desired output:
NameDistinct count of cases
Chip Jones
2​
Sam Smith
1​
Tim Sanders
3​
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about
+Fluff 1.xlsm
ABCDEF
1NameCaseNameDistinct count of cases
2Chip JonesABC1Chip Jones2
3Chip JonesABC1Sam Smith1
4Chip JonesDEF2Tim Sanders3
5Sam SmithGHI3
6Sam SmithGHI3
7Tim SandersJKL4
8Tim SandersMNO5
9Tim SandersMNO5
10Tim SandersPQR6
Lists
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT((IF($A$2:$A$10=E2,1/COUNTIFS($A$2:$A$10,E2,$B$2:$B$10,$B$2:$B$10))))
 
Upvote 0
Solution
How about
+Fluff 1.xlsm
ABCDEF
1NameCaseNameDistinct count of cases
2Chip JonesABC1Chip Jones2
3Chip JonesABC1Sam Smith1
4Chip JonesDEF2Tim Sanders3
5Sam SmithGHI3
6Sam SmithGHI3
7Tim SandersJKL4
8Tim SandersMNO5
9Tim SandersMNO5
10Tim SandersPQR6
Lists
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT((IF($A$2:$A$10=E2,1/COUNTIFS($A$2:$A$10,E2,$B$2:$B$10,$B$2:$B$10))))
This is perfect - thank you for the quick reply!
 
Upvote 0
Map1
ABCDEF
1NameCaseNameCase
2Chip JonesABC1Chip Jones2
3Chip JonesABC1Sam Smith1
4Chip JonesDEF2Tim Sanders3
5Sam SmithGHI3 
6Sam SmithGHI3 
7Tim SandersJKL4 
8Tim SandersMNO5 
9Tim SandersMNO5
10Tim SandersPQR6
Blad1
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT(($A$2:$A$10=E2)/COUNTIF($B$2:$B$10,$B$2:$B$10))
E2:E8E2=IFERROR(INDEX($A$2:$A$10,MATCH(0,COUNTIF($E$1:E1,$A$2:$A$10),0)),"")
 
Upvote 0
Map1
ABCDEF
1NameCaseNameCase
2Chip JonesABC1Chip Jones2
3Chip JonesABC1Sam Smith1
4Chip JonesDEF2Tim Sanders3
5Sam SmithGHI3 
6Sam SmithGHI3 
7Tim SandersJKL4 
8Tim SandersMNO5 
9Tim SandersMNO5
10Tim SandersPQR6
Blad1
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT(($A$2:$A$10=E2)/COUNTIF($B$2:$B$10,$B$2:$B$10))
E2:E8E2=IFERROR(INDEX($A$2:$A$10,MATCH(0,COUNTIF($E$1:E1,$A$2:$A$10),0)),"")
I've always wondered if there was a way to pull out the distinct names, per your instruction for cell E2! This is fantastic to learn!! Thank you
 
Upvote 0
Lol take Fluff's formula for distinct count :LOL:
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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