Excel Question re: counting duplicate entries

Most of us are not "computer people" so post your technical questions and comments here. If you have computer or Internet expertise, share it here.

Moderators: carlson1, Keith B

Post Reply
User avatar

Topic author
Charles L. Cotton
Site Admin
Posts in topic: 4
Posts: 17787
Joined: Wed Dec 22, 2004 9:31 pm
Location: Friendswood, TX
Contact:

Excel Question re: counting duplicate entries

#1

Post by Charles L. Cotton »

I need to be able to count the total number of duplicate entries in a table. I know how to do this with a pivot table, but that won't work for our purpose. We need to be able to determine the total number of duplicate entries so we can get a net number and compare that to our Club database. We don't care who has a duplicate entry. The key field for determining duplicates would be a member number.

Thanks,
Chas.
User avatar

Keith B
Moderator
Posts in topic: 1
Posts: 18494
Joined: Sat Aug 18, 2007 3:29 pm

Re: Excel Question re: counting duplicate entries

#2

Post by Keith B »

See if this does what you need http://office.microsoft.com/en-us/excel ... 1&client=1" onclick="window.open(this.href);return false;
Keith
Texas LTC Instructor, Missouri CCW Instructor, NRA Certified Pistol, Rifle, Shotgun Instructor and RSO, NRA Life Member

Psalm 82:3-4
User avatar

Topic author
Charles L. Cotton
Site Admin
Posts in topic: 4
Posts: 17787
Joined: Wed Dec 22, 2004 9:31 pm
Location: Friendswood, TX
Contact:

Re: Excel Question re: counting duplicate entries

#3

Post by Charles L. Cotton »

Keith B wrote:See if this does what you need http://office.microsoft.com/en-us/excel ... 1&client=1" onclick="window.open(this.href);return false;
Thanks Keith, that gives me a quick way to check duplicate Members. I also created a macro copying the entire sheet to a new tab. Then duplicates are deleted and a count function is used to get me a number I can make available to our Membership Director.

In case anyone is wondering, no we don't have a membership records on an Excel spreadsheet. This is for something else within the Club.

Thanks again,
Chas.
User avatar

RogueUSMC
Senior Member
Posts in topic: 2
Posts: 1513
Joined: Tue Apr 30, 2013 12:55 pm
Location: Smith County
Contact:

Re: Excel Question re: counting duplicate entries

#4

Post by RogueUSMC »

If the duplicates you are truing to find are all on the same column, just select the column and use the conditional formatting to change the color, font, size, weight, etc for anything that has a duplicate. You can leave the conditional formatting intact, then as you enter data, it will highlight duplicates live.
A man will fight harder for his interests than for his rights.
- Napoleon Bonaparte
PFC Paul E. Ison USMC 1916-2001
User avatar

Topic author
Charles L. Cotton
Site Admin
Posts in topic: 4
Posts: 17787
Joined: Wed Dec 22, 2004 9:31 pm
Location: Friendswood, TX
Contact:

Re: Excel Question re: counting duplicate entries

#5

Post by Charles L. Cotton »

RogueUSMC wrote:If the duplicates you are truing to find are all on the same column, just select the column and use the conditional formatting to change the color, font, size, weight, etc for anything that has a duplicate. You can leave the conditional formatting intact, then as you enter data, it will highlight duplicates live.
Thanks, but I don't need to identify the duplicates, I need a count of the duplicates. This is so we can get a net figure for Members who have accomplished a specified task.

Chas.
User avatar

Jumping Frog
Senior Member
Posts in topic: 2
Posts: 5488
Joined: Wed Aug 25, 2010 9:13 am
Location: Klein, TX (Houston NW suburb)

Re: Excel Question re: counting duplicate entries

#6

Post by Jumping Frog »

Charles L. Cotton wrote:Thanks, but I don't need to identify the duplicates, I need a count of the duplicates. This is so we can get a net figure for Members who have accomplished a specified task.
It depends on how you want to count the duplicates.

Assume you have the following names in Column A:

A1-Name
A2-Bob
A3-Charles
A4-Charles
A5-David

If the first instance of "Charles" does not count as a duplicate, but only the second "Charles" duplicate entry is counted, then create a column with the next formula, and then copy it down it's own column:

=if(a3=a2,1,0)

Now sum that column, and your count will be equal to 1.

However, if you want to count both instances of "Charles" as a duplicate, so that your total for both = 2, then create a column with the next formula, and then copy it down it's own column:

=if(or(a2=a1,a2=a3),1,0)

Now sum that column
-Just call me Bob . . . Texas Firearms Coalition, NRA Life member, TSRA Life member, and OFCC Patron member

This froggie ain't boiling! Shall not be infringed! Μολών Λαβέ
User avatar

jimlongley
Senior Member
Posts in topic: 1
Posts: 6134
Joined: Wed Jan 12, 2005 1:31 pm
Location: Allen, TX

Re: Excel Question re: counting duplicate entries

#7

Post by jimlongley »

Jumping Frog wrote:
Charles L. Cotton wrote:Thanks, but I don't need to identify the duplicates, I need a count of the duplicates. This is so we can get a net figure for Members who have accomplished a specified task.
It depends on how you want to count the duplicates.

Assume you have the following names in Column A:

A1-Name
A2-Bob
A3-Charles
A4-Charles
A5-David

If the first instance of "Charles" does not count as a duplicate, but only the second "Charles" duplicate entry is counted, then create a column with the next formula, and then copy it down it's own column:

=if(a3=a2,1,0)

Now sum that column, and your count will be equal to 1.

However, if you want to count both instances of "Charles" as a duplicate, so that your total for both = 2, then create a column with the next formula, and then copy it down it's own column:

=if(or(a2=a1,a2=a3),1,0)

Now sum that column
But what happens if thew dupes are not in adjacent cells?

Gets a little more complicated.
Real gun control, carrying 24/7/365
User avatar

Jumping Frog
Senior Member
Posts in topic: 2
Posts: 5488
Joined: Wed Aug 25, 2010 9:13 am
Location: Klein, TX (Houston NW suburb)

Re: Excel Question re: counting duplicate entries

#8

Post by Jumping Frog »

Yes, the assumption made is the cells of interest are sorted.
-Just call me Bob . . . Texas Firearms Coalition, NRA Life member, TSRA Life member, and OFCC Patron member

This froggie ain't boiling! Shall not be infringed! Μολών Λαβέ
User avatar

RogueUSMC
Senior Member
Posts in topic: 2
Posts: 1513
Joined: Tue Apr 30, 2013 12:55 pm
Location: Smith County
Contact:

Re: Excel Question re: counting duplicate entries

#9

Post by RogueUSMC »

Using the filters, give each 'task' an identifier listing all tasks in one column, you can cull your list by task, member, date, etc. six ways to Sunday and leave your data intact. I do this with our warehouse inventory. I can filter down to a certain SKU and tell you how many we have gotten, how many we have sent out...I can even tell you what purchase order they were received on with duplicate lines for different dates, then refilter by that purchase order and date to see what was on the truck with it...all without even resorting the data itself.
A man will fight harder for his interests than for his rights.
- Napoleon Bonaparte
PFC Paul E. Ison USMC 1916-2001
User avatar

Topic author
Charles L. Cotton
Site Admin
Posts in topic: 4
Posts: 17787
Joined: Wed Dec 22, 2004 9:31 pm
Location: Friendswood, TX
Contact:

Re: Excel Question re: counting duplicate entries

#10

Post by Charles L. Cotton »

Okay, I guess I was being a little too cryptic. To renew your PSC Membership, one must watch a safety video and pass a related exam. All of this is automated and Members' scores are in a database. I export this data to Excel for analysis and to upload to a different database/website.

If a person fails the exam and then passes later, there are two entries for the Member making it impossible to quickly identify how many of our Members have yet to pass the safety exam. Some Members pass the exam but take it again, apparently trying to get a perfect score.

I solved the problem with a macro, but I was hoping to use one that was a bit more efficient.

Thanks,
Chas.
Post Reply

Return to “Technical Tips, Questions & Discussions (Computers & Internet)”