Formula or Code to highlight when only 2 matching in cell

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,783
Office Version
  1. 365
Platform
  1. Windows
I have column C laid out as below. I would like a formula or code please to highlight when there are only 2 that match. As you can see in example I have highlighted in yellow how the results would look. Thanks


Excel 2010
C
9228FTGRAP13D 1001
9229FTGRAP13D 1001
9230FTGRAP13D 1004
9231FTGRAP13D 1004
9232FTGRAP13D 1004
9233FTGRAP14 1001
9234FTGRAP14 1001
9235FTGRAP14 1001
9236FTGRAP14 1004
9237FTGRAP14 1004
Sheet2
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Select the cells in col C & with conditional formatting, use this formula

=COUNTIF(C$2:C$1000,C2)=2
Change the start & end rows to suit
 
Upvote 0
Thanks, is there a way without conditional formatting? It is a massive sheet of 100,000 rows and it just keeps freezing when trying to sort or if I delete rows it recalculates again and freezes again....

I've also noticed it doesn't give the required results.
 
Last edited:
Upvote 0
You could put that formula in col D & copy down, it will then show either TRUE or FALSE.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Hi I am amending this formula to allow 3 rather than 2, but it returns False on all?
 
Upvote 0
That should work

Excel 2013/2016
BCD
29228FTGRAP13D 1001FALSE
39229FTGRAP13D 1001FALSE
49230FTGRAP13D 1004TRUE
59231FTGRAP13D 1004TRUE
69232FTGRAP13D 1004TRUE
79233FTGRAP14 1001TRUE
89234FTGRAP14 1001TRUE
99235FTGRAP14 1001TRUE
109236FTGRAP14 1004FALSE
119237FTGRAP14 1004FALSE
List
Cell Formulas
RangeFormula
D2=COUNTIF(C$2:C$1000,C2)=3
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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