# Count Unique Names when in Two Colums

#### gkitt80

##### New Member
Hello All,

I need to count the number of times a unique name shows up in a table of data. The issue I am having is the names are split up into 2 columns, "LastName" and "FirstName." Obviously, some last names are very common, and thus if I only counted the number of unique last names I wouldn't get an accurate number. Any help would be much appreciated.

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### facethegod

##### Well-known Member
so if your first and last names are in to columns say A and B then in C

try this and drag down
Code:
``=A1&B1``

then in D1 try this and confirm w/ ctrl + shift + Enter, not just enter

Code:
``=SUM(1/COUNTIF(C1:C9,C1:C9))``

##### MrExcel MVP
Hello All,

I need to count the number of times a unique name shows up in a table of data. The issue I am having is the names are split up into 2 columns, "LastName" and "FirstName." Obviously, some last names are very common, and thus if I only counted the number of unique last names I wouldn't get an accurate number. Any help would be much appreciated.

Given A2:B7...

Control+shift+enter:

Code:
``````=SUM(IF(FREQUENCY(IF(\$B\$2:\$B\$7<>"",
MATCH("~"&\$A\$2:\$A\$7&"-"&\$B\$2:\$B\$7,
\$A\$2:\$A\$7&"-"&\$B\$2:\$B\$7&"",0)),
ROW(\$B\$2:\$B\$7)-ROW(\$B\$2)+1),1))``````

Replies
11
Views
250
Replies
5
Views
203
Replies
1
Views
265
Replies
11
Views
593
Replies
4
Views
249

1,191,166
Messages
5,985,050
Members
439,935
Latest member
Monty238

### 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.

### Which adblocker are you using?

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

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