VBA Count Duplicates from a varied range on one sheet using another sheets list

decadence

Well-known Member
Joined
Oct 9, 2015
Messages
525
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
  5. 2007
Platform
  1. Windows
Is it possible to count number of instances of duplicate and unique cells found from a varied range using a list of data from another sheet as a reference to on what to look for? My data will be varied with up to 20,000 rows and up to 10 columns Also the cells will contain both numbers and letters, I will have 2 sheets one with the duplicate data and another with Total Duplicates. Can someone help with this please? Thanks

Example:

From this (Duplicates sheet)

Header 1
Header 2
Header 3
Header 4
Header 5
Apple
Banana
Orange
Pear
Grapes
Orange
Apple
Pear
Apple
Orange
Orange
Pear
Apple
Orange
Pear
Pear
Orange
Pear
Pear
Apple

<tbody>
</tbody>

To This (Total Duplicates Sheet)

Duplicates
Count
Apple
5
Banana
1
Orange
6
Pear
7
Grapes
1

<tbody>
</tbody>
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about
=COUNTIF(Sheet1!$A$2:$E$5,A2)
 
Upvote 0
Hi Fluff, thanks for the reply however this formula is for the example, my data is varied so I can't specify exact range
 
Upvote 0
In that case how about
=COUNTIF(Sheet1!A:L,A2)
Change the L to the last column you are likely to get
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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