Highlight Duplicate Values, Non Contiguous Cells

cloyd1980

New Member
Joined
Feb 11, 2013
Messages
19
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
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try :

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

I hope that helps you
 
Upvote 0
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:
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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