Counting names in a list

ChIpStIcK

New Member
Joined
Dec 12, 2011
Messages
25
Hi, this feels like it should be easy but I can't work it out so have resorted to begging:

I have a column of random names, say 200 of them in column A. I want to have column D show a name if (and only if) it appears more than once and have a count of how many times it appears in column E.

I can't use vba. Please help!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi. Welcome to the board.

There are complex formula systems that will do this, but a fairly straightforward way is:

1) add a new column to the data that flags if a name turns up more than once:

=counitf(a1,$a$1:$a$200)>1

2) set up a pivot table, include the new variable as a page field. only include TRUEs in the pivot.

quicker to do than explain.
 
Upvote 0
Hi, this feels like it should be easy but I can't work it out so have resorted to begging:

I have a column of random names, say 200 of them in column A. I want to have column D show a name if (and only if) it appears more than once and have a count of how many times it appears in column E.

I can't use vba. Please help!
What version of Excel are you using?
 
Upvote 0
Not the best way to do this but:

1. In D1:

=IF(COUNTIF(A:A,A1)>1,A1,"")

2. In D2 and drag down to the end of the list:

=IF(COUNTIF($D$1:D1,A2),"",IF(COUNTIF(A:A,A2)>1,A2,""))

3. In E1 and drag down to the end of the list:

=IF(LEN(D1)>0,COUNTIF(A:A,D1),"")

4. Copy columns D and E and sort
 
Upvote 0
Thanks hugely for the amazingly quick responses there. Its Excel 2002. I havnt had a chance to try these out but will let you know how I get on.
 
Upvote 0
What version of Excel are you using?

Its Excel 2002.
Try this...

Book1
ABCDE
1Names_DupesNamesCount
2Tom_5Tom4
3Tom__Larry5
4Tom__Kim2
5Tom__Eric2
6Lisa__Karen2
7Sue____
8Larry____
9Larry____
10Larry____
11Larry____
12Larry____
13Kim____
14Kim____
15Eric____
16Eric____
17Paul____
18Sam____
19Karen____
20Karen____
Sheet1

Enter this array formula** in C2. This will return the count of duplicates.

=SUM(IF(FREQUENCY(MATCH(A2:A20,A2:A20,0),ROW(A2:A20)-ROW(A2)+1)>1,1))

Enter this array formula** in D2:

=IF(ROWS(D$2:D2)>C$2,"",INDEX(A:A,SMALL(IF(FREQUENCY(MATCH(A$2:A$20,A$2:A$20,0),ROW(A$2:A$20)-ROW(A$2)+1)>1,ROW(A$2:A$20)),ROWS(D$2:D2))))

Enter this formula in E2:

=IF(D2="","",COUNTIF(A:A,D2))

Select both D2 and E2 and copy down until you get blanks.

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Wont let me edit after 10 minutes so I'll reply again.

Trying it out I have a couple of problems:

1) In the example above, if say cells A20 and A19 are blank, then the formulas return value not available errors. This is problematic as I wont know how many names are on the list (people will be adding two or three every day for a month and there's a new sheet each month is how it works if you're interested).

2) When I copy down I get the same name with the same count in D and E, although I do get the right number of lines for the number of dupes in the list before it goes blank. Which is to say, in the above example "Tom 4" would be in rows 2-6 then it would, as it should, go blank.
 
Upvote 0
Wont let me edit after 10 minutes so I'll reply again.

Trying it out I have a couple of problems:

1) In the example above, if say cells A20 and A19 are blank, then the formulas return value not available errors. This is problematic as I wont know how many names are on the list (people will be adding two or three every day for a month and there's a new sheet each month is how it works if you're interested).

2) When I copy down I get the same name with the same count in D and E, although I do get the right number of lines for the number of dupes in the list before it goes blank. Which is to say, in the above example "Tom 4" would be in rows 2-6 then it would, as it should, go blank.
To account for empty cells...

Book1
ABCDE
1Names_DupesNamesCount
2Tom_5Tom4
3Tom__Larry5
4Tom__Kim2
5Tom__Eric2
6Lisa____
7Sue___
8Larry____
9Larry____
10Larry____
11Larry____
12Larry____
13Kim____
14Kim____
15Eric____
16Eric____
17Paul____
18Sam____
19_____
20_____
Sheet2

This array formula** entered in C2:

=SUM(IF(FREQUENCY(IF(A2:A20<>"",MATCH(A2:A20,A2:A20,0)),ROW(A2:A20)-ROW(A2)+1)>1,1))

This array formula** entered in D2:

=IF(ROWS(D$2:D2)>C$2,"",INDEX(A:A,SMALL(IF(FREQUENCY(IF(A$2:A$20<>"",MATCH(A$2:A$20,A$2:A$20,0)),ROW(A$2:A$20)-ROW(A$2)+1)>1,ROW(A$2:A$20)),ROWS(D$2:D2))))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

This formula entered in E2:

=IF(D2="","",COUNTIF(A:A,D2))

Select both D2 and E2 and copy down until you get blanks.
 
Upvote 0
Mind pasting me your second line of copy downs? Cant get it to show anything but the first dupe name and I can't work out what I should be changing for each line.
 
Upvote 0

Forum statistics

Threads
1,223,727
Messages
6,174,146
Members
452,547
Latest member
Schilling

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