Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
    
why only consecutive duplicates and not all? –  Aprillion Oct 13 '12 at 15:19

3 Answers 3

up vote 1 down vote accepted

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.

share|improve this answer

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

share|improve this answer

Try this

enter image description here

You will also need conditional formatting. enter image description here

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.