ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   format cell based on previous one (https://www.excelbanter.com/excel-worksheet-functions/59560-format-cell-based-previous-one.html)

thisisjampers

format cell based on previous one
 
I'm using conditional formats to seperate groups of data. For example, when
the content of a cell in column A changes from the previous row to the next,
the conditional format puts a bold border on top (as opposed on a light
border). The problem arises when I insert a row. Then every comparison below
that new row compares to 2 rows up, not 1 row up.
Ideas appreciated.

thisisjampers

format cell based on previous one
 
I will describe the problem more clearly:
I have several rows of information. Column A contains the main group for
each row. The items are sorted so all items in the main group are together.
Every time the main group changes, I want to put a thicker format line above
that group. For example:
A/B/C
1] cow/white/500
2] cow/black/450
3] cow/spotted/398
4] horse/brown/333
5] horse/black/450
6] pig/tan/340
7] pig/white/322
So I want thick lines above row 1, 4 and 6.
And if I insert a row, it doesn't affect it.
This is what I used in the conditional format, but row insertions messes it
up.
=$A7<$A6 (then format with thick line on top of cell)

"thisisjampers" wrote:

I'm using conditional formats to seperate groups of data. For example, when
the content of a cell in column A changes from the previous row to the next,
the conditional format puts a bold border on top (as opposed on a light
border). The problem arises when I insert a row. Then every comparison below
that new row compares to 2 rows up, not 1 row up.
Ideas appreciated.


thisisjampers

format cell based on previous one
 
All right, I figured it out. The conditional statement looks like this:
=INDEX($A$1:$A$100,ROW(),1)<INDEX($A$1:$A$100,ROW ()-1,1)

"thisisjampers" wrote:

I will describe the problem more clearly:
I have several rows of information. Column A contains the main group for
each row. The items are sorted so all items in the main group are together.
Every time the main group changes, I want to put a thicker format line above
that group. For example:
A/B/C
1] cow/white/500
2] cow/black/450
3] cow/spotted/398
4] horse/brown/333
5] horse/black/450
6] pig/tan/340
7] pig/white/322
So I want thick lines above row 1, 4 and 6.
And if I insert a row, it doesn't affect it.
This is what I used in the conditional format, but row insertions messes it
up.
=$A7<$A6 (then format with thick line on top of cell)

"thisisjampers" wrote:

I'm using conditional formats to seperate groups of data. For example, when
the content of a cell in column A changes from the previous row to the next,
the conditional format puts a bold border on top (as opposed on a light
border). The problem arises when I insert a row. Then every comparison below
that new row compares to 2 rows up, not 1 row up.
Ideas appreciated.



All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com