Counting locations per name

Spreadsheetz

New Member
Joined
Jun 12, 2016
Messages
22
Hello!

Hopefully this is an easy one.. I have a spreadsheet with a number of names in one column, and locations in another column. I'm hoping to find a formula that can tell me how many times the location shows up per person.

For example:[TABLE="width: 500"]
<tbody>[TR]
[TD]location[/TD]
[TD]name[/TD]
[/TR]
[TR]
[TD]Calfornia[/TD]
[TD]Jeff[/TD]
[/TR]
[TR]
[TD]Maine[/TD]
[TD]Mary[/TD]
[/TR]
[TR]
[TD]California[/TD]
[TD]Jeff[/TD]
[/TR]
[TR]
[TD]Michigan[/TD]
[TD]Mary[/TD]
[/TR]
[TR]
[TD]Michigan[/TD]
[TD]Mary[/TD]
[/TR]
[TR]
[TD]Wyoming[/TD]
[TD]Jeff[/TD]
[/TR]
</tbody>[/TABLE]

Is there a function to use that could quickly spit out something like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]location[/TD]
[TD]name[/TD]
[TD]count[/TD]
[/TR]
[TR]
[TD]california[/TD]
[TD]jeff[/TD]
[TD]2 california, 1 wyoming[/TD]
[/TR]
[TR]
[TD]maine[/TD]
[TD]mary[/TD]
[TD]2 michigan, 1 maine[/TD]
[/TR]
[TR]
[TD]california[/TD]
[TD]jeff[/TD]
[TD]2 california, 1 wyoming[/TD]
[/TR]
[TR]
[TD]Michigan[/TD]
[TD]Mary[/TD]
[TD]2 michigan, 1 maine[/TD]
[/TR]
[TR]
[TD]Michigan[/TD]
[TD]mary[/TD]
[TD]2 michigan, 1 maine[/TD]
[/TR]
[TR]
[TD]Wyoming[/TD]
[TD]Jeff[/TD]
[TD]2 california, 1 wyoming[/TD]
[/TR]
</tbody>[/TABLE]

Just a count of how many times the value in the location column occurs per name.

Thanks in advance!!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]location[/TD]
[TD]name[/TD]
[TD][/TD]
[TD]name[/TD]
[TD]location[/TD]
[TD]California[/TD]
[TD]Michigan[/TD]
[TD]Wyoming[/TD]
[TD]Maine[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]California[/TD]
[TD]Jeff[/TD]
[TD][/TD]
[TD]Jeff[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD]
0​
[/TD]
[TD]
1​
[/TD]
[TD]
0​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]Maine[/TD]
[TD]Mary[/TD]
[TD][/TD]
[TD]Mary[/TD]
[TD][/TD]
[TD]
0​
[/TD]
[TD]
1​
[/TD]
[TD]
0​
[/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]California[/TD]
[TD]Jeff[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]Maine[/TD]
[TD]Mary[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]Michigan[/TD]
[TD]Mary[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]Wyoming[/TD]
[TD]Jeff[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

f2=COUNTIFS($B$2:$B$7,$D2,$A$2:$A$7,F$1) copy across and down
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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