0

Example, this is the data in Excel:

1 2
2 2
3 4
3 4
3 3
2 2
2 2
1 2

The rows which have consecutive duplicate column-pair values (in bold font) should be highlighted:

1 2
2 2
3 4
3 4
3 3
2 2
2 2
1 2

1
  • why only consecutive duplicates and not all?
    – Aprillion
    Oct 13, 2012 at 15:19

3 Answers 3

1

This can be done by just using conditional formatting:

example

Highlight the entire range. Select Conditional Formatting and choose to use a formula. Type the formula: =OR(AND($B3=$B2,$C3=$C2),AND($B3=$B4,$C3=$C4)) (assuming your range is B3:C9). Select your formatting.

Explanation: The formula assumes is basically applied to every cell, but you write it assuming you're in the first cell in the range and assume that excel will copy it to the rest. That's why the columns are absolute references ($'s before the B's and C's), so the columns are constant even as it's 'copied' to the rest of the cells.

0

If a third column can be used instead you can easily achieve this with a formula

=if(AND(A1==A2 ; B1==B2);"Duplicate";"")

Paste this in col 3 row 2 and copy till the bottom

p.s. syntax might be slightly off on excel, this was tested on open office

0

Try this

enter image description here

You will also need conditional formatting. enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .