Highlighting Duplicate Values within N rows

jonnyg860

New Member
Joined
Apr 7, 2011
Messages
2
I have a worksheet where employees scan barcodes of ISBN and Price into two columns. Right now I have a simple conditional format to highlight duplicates within each row. Is it possible to highlight duplicate values found within say 10 rows, rather than the entire column. I want it to alert them if they mistakenly scanned the same book twice, but not if it was same title scanned hours earlier. We use office 2010 with windows 7.

Thanks for any help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You can use this for your conditional formatting starting in the cell on the 10th row and then use the format painter to copy that format down your worksheet.

As the cell moves down, the range will also move down so that the conditional formatting will still work. The test for "" prevents all the blank spaces from being highlighted.

IF(A10="",0,COUNTIF(A1:A10,A10))>1
IF(A11="",0,COUNTIF(A2:A11,A11))>1
IF(A12="",0,COUNTIF(A3:A12,A12))>1

The only drawback is that you can't use this in Rows 1-9 because if you move backwards, the cell tries to reference A0 and then A-1, which are not valid cell names and you'll get a #REF error, but this will work for all but the first 9 rows.
 
Upvote 0

Forum statistics

Threads
1,214,521
Messages
6,120,018
Members
448,937
Latest member
BeerMan23

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