Alternate to COUNTIF(E$6:E6,E6)

earthworm

Well-known Member
Joined
May 19, 2009
Messages
773
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I have a huge data set and i need to identify duplicate . I am using the formula COUNTIF(E$6:E6,E6) but this formula slows the calculation significantly in huge list approx 65000 rows. Is there any fastest formula ?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
COUNTIF is an expensive function. Alternatives will be expensive too if copied down to a huge number of cells. By the way, you did not answer the question of why you need to copy down this formula.
 
Upvote 0
COUNTIF is an expensive function. Alternatives will be expensive too if copied down to a huge number of cells. By the way, you did not answer the question of why you need to copy down this formula.

I need to identify 1 instance only and then extract .

I have find an alternative . Using advance filter to extract unique record seems feasible .

However Now i m confused . How can i extract duplicate / more then one instance record through advance filter :(
 
Upvote 0
I need to identify 1 instance only and then extract .

I have find an alternative . Using advance filter to extract unique record seems feasible .

This is a quite adequate method to extract unique records.

However Now i m confused . How can i extract duplicate / more then one instance record through advance filter :(

That is also possible.

Let E5 house a header, something like #Items #.

Let F4 empty.
In F5 enter:

=COUNTIF($E$6:$E$14,E6)=2

Now select F4:F5.
Fire up Advanced Filter.
Click OK when it complains.
Check the option for Copy to another location.
For List range: Select the relevant range including the header.
For Criteria range: Select $F$5:$F$6.
For Copy to: Select the F7 cell.
Click OK.

If done properly, Advanced Filter will deliver an output consisting of items which occur only twice.
 
Upvote 0
This is a quite adequate method to extract unique records.



That is also possible.

Let E5 house a header, something like #Items #.

Let F4 empty.
In F5 enter:

=COUNTIF($E$6:$E$14,E6)=2

Now select F4:F5.
Fire up Advanced Filter.
Click OK when it complains.
Check the option for Copy to another location.
For List range: Select the relevant range including the header.
For Criteria range: Select $F$5:$F$6.
For Copy to: Select the F7 cell.
Click OK.

If done properly, Advanced Filter will deliver an output consisting of items which occur only twice.

Not working.

Please refer sheet.

https://app.box.com/s/0y7lhqkfavf3kx6im9gcy08yyxdlbkiw
 
Upvote 0

It works as advertised. Using your file, I get:

[TABLE="class: grid, width: 256"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: transparent"][/TD]
[TD="width: 64, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=00B050]#00B050[/URL] "][/TD]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]items[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=00B050]#00B050[/URL] , align: center"]FALSE[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]A[/TD]
[TD="bgcolor: transparent"]items[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]A[/TD]
[TD="bgcolor: transparent"]B[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]A[/TD]
[TD="bgcolor: transparent"]B[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]A[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]A[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]B[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]B[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]D[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]C[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]

As you see, with:

=COUNTIF($E$6:$E$14,E6)=2

in F5, we get doublets, that is, items that occur only twice.

If you want Advanced Filter to display only the names of doublets, check the Unique records only box before you hit OK.

For triplets, set up the criteria range in G4:G5 for example, with G5 housing:

=COUNTIF($E$6:$E$14,E6)=3

For all items which occur twice or more, invoke:

=COUNTIF($E$6:$E$14,E6)>1

<strike>
</strike>
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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