Highlight Duplicate Values, Non Contiguous Cells

cloyd1980

New Member
Joined
Feb 11, 2013
Messages
17
Hi all,

I am trying to apply a simple conditional format where cells with the same value are highlighted. The problem I am running into is that the data I want to apply the formatting to is in every other row (2, 4, 6, etc). The formatting works fine if the the duplicate value appears in the same row (for example B2 and E2), but if the duplicate value is in a different row it does not work (for example B2 and B4). Does anyone know how to fix this?

Thanks,
Corey
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
8,900
Office Version
2007
Platform
Windows
Try :

- Select your range, ge. "B2:E20"
- Conditional Formatting, Highlight Cells Rules, and then Duplicate Values.

I hope that helps you
 

cloyd1980

New Member
Joined
Feb 11, 2013
Messages
17
The problem is that my data isn't in B2:E20, it would be in B2:E2, B4:E4, B6:E6, etc
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
8,900
Office Version
2007
Platform
Windows
Try :


- Select your range, eg. "B2:E20"
- Conditional Formatting
- In the New Formatting Rule dialog box, click Use a formula to determine which cells to format.
- Under Format values where this formula is true, type the formula:

Code:
=AND(B2<>"",ISEVEN(ROW(B2)),SUM(IF(MOD(ROW([COLOR=#ff0000]$B$2:$E$20[/COLOR]),2)=0,IF([COLOR=#ff0000]$B$2:$E$20[/COLOR]=B2,1)))>1)
- Applies to:
=$B$2:$E$20

Change $B$2:$E$20 for the desired range.

 
Last edited:

cloyd1980

New Member
Joined
Feb 11, 2013
Messages
17
Try :


- Select your range, eg. "B2:E20"
- Conditional Formatting
- In the New Formatting Rule dialog box, click Use a formula to determine which cells to format.
- Under Format values where this formula is true, type the formula:

Code:
=AND(B2<>"",ISEVEN(ROW(B2)),SUM(IF(MOD(ROW([COLOR=#ff0000]$B$2:$E$20[/COLOR]),2)=0,IF([COLOR=#ff0000]$B$2:$E$20[/COLOR]=B2,1)))>1)
- Applies to:
=$B$2:$E$20

Change $B$2:$E$20 for the desired range.

Dante, this worked perfectly! Thank you very much! I never would have come up with that formula on my own.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
8,900
Office Version
2007
Platform
Windows
I'm glad to help you. Thanks for the feedback.
 

Forum statistics

Threads
1,082,359
Messages
5,364,916
Members
400,815
Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top