# Using CountIf for duplicates

Hi Folks
Just wanted to check if I'm on track with this solution. I have a file with 6 columns and I'm not sure if I have duplicates or not. My workaround has been to create a new field, which concatenates all the elements of each transaction and then uses conditional formatting to flag those which are duplicates. It seems to work :-) but should I also use a Count if with this to check and if so, how would I structure it?
Thanks
LVL 1
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
in excel 2007 and above you have the option to remove duplicates. this will also count them if it's a one off this is the fasted way.
0
Commented:
this approach will work as long as you consider a duplicate to be when all columns are identical and in the same order.

to use countif to count the number of times a particiular value repeats in column A (for example) is to put the following in column B and copy down:-

=Countif(\$a\$1:\$a1, \$a1)

Not the 'missing' dollar sign on the second part of the range.

If you have sorted column A you will find that column b now has a 1 for non-identical (first match) and then 2,3,4 etc for subsequent matches.

Hope this helps

Reg
0
Finance AnalystCommented:
If your data is sorted you can use a simple formula in H (assumed A _ F data, G concatenated):

=G1=G2  to get a TRUE or FALSE for duplicates.

If not sorted then:

=COUNTIF(G:G,G1)

copy down, will return number of entries same as reference cell. Apply autofilter to column and show those where greater than 1.

How are you applying the Conditional Formatting? I assume you are using a formula to apply formatting.

In Excel 2007 and later there is a Show Dulicates option on the Data ribbon.

Thanks
Rob H
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
@RobHenson - will try that. Yes, I'm using the Show duplicates option :-) Thank you!
A
0
Commented:
The ID Filed Enter your suspicious duplicate data, then Click on Run then you can find how many records are duplicates, for example more than 2 time all are duplicates
Run.xls
0
Author Commented:
Thank you all very much!
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.