count duplicates

mwperkins

Board Regular
Joined
Oct 29, 2002
Messages
153
Hi
is there an array formula that can count how many duplicates exist in column A?

thanks
Mark
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

jorismoerings

Well-known Member
Joined
Jul 4, 2014
Messages
1,284
Hi mark,

try this =SUM(1/COUNTIF($A$1:$A$100,$A$1:$A$100)) as array.
Adjust the range to your need and be aware this will only work if there are no blanks in your range.

An non array alternative could be: =SUMPRODUCT(($A$1:$A$100<>"")/COUNTIF($A$1:$A$100,$A$1:$A$100&""))

Hope this helps
 

mwperkins

Board Regular
Joined
Oct 29, 2002
Messages
153
many thanks, but both formulas tell me how many different values there are, not how many values occur more than once
 

jorismoerings

Well-known Member
Joined
Jul 4, 2014
Messages
1,284
Hi Mark,

You're right. So add a simple count to the formula.
So it becomes: =COUNT($A$1:$A$100)-SUMPRODUCT(($A$1:$A$100<>"")/COUNTIF($A$1:$A$100,$A$1:$A$100&""))
This will give you the number of duplicate value in the list however not which one.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,305
Messages
5,600,867
Members
414,410
Latest member
4610

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
Top