View Single Post
  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Here's one method you could try.

You need a helper column for each column that you want to compare. In your
example you're comparing 2 columns so you need 2 helper columns. Also, there
should be an empty row above the start of your data. So, if your data starts
in row 2 and row 1 is empty:

Based on Harlan Grove's formulas for counting consecutive cells:

In C2 enter this formula and copy across to D2:

=IF(A3<A2,1,"")

In C3 enter this formula and copy across to D3:

=IF(A4<A3,ROWS(C$2:C3)-IF(COUNT(C$2:C2),LOOKUP(2,1/ISNUMBER(C$2:C2),ROW(C$2:C2)-1),0),"")

Select both C3 and D3 and copy down to the end of your data.

Now, since you wanted to identify 5 consecutive entries and based on your
sample data, cells C9 and D9 should equal 5.

Now, use conditional formatting.

Select the rows in which your data resides. In your example this would be
rows 2:14.

Goto FormatConditional Formatting
Formula is: =AND($C2=5,$D2=5)
Select a format style. Maybe a background fill color.
OK out.

This will only highlight a single row. Maybe if I had more time I could
figure out how to highlight all 5 rows but this will at least get you headed
in the right direction.

Biff

"carl" wrote in message
...
I am trying to highlight rows in my data to make it possible to spot
patterns. For example, in the table below is it possible to highlight the
rows when there are 5 consecutive identical values in ColA and ColB. In
the
table, rows 4,5,6,7,8 would be highlighted but rows 9,10,11,12,13 would
not
be.

Thank you in advance.

Row ColA ColB
1 ABC 123
2 DEF 456
3 HIJ 789
4 ABC 123
5 ABC 123
6 ABC 123
7 ABC 123
8 ABC 123
9 DEF 456
10 DEF 456
11 DEF 456
12 DEF 456
13 DEF 123