cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
miguello
Level VI

How to highlight cell if previous row is different (kinda conditional formatting in Excel)

Running a DOE experiment for the first time.

Afraid to misread a value for a factor - tens of factors, tens of runs. Any way for a specific row to highlight a cell if its value is different from cell value in a previous row? So that I don't miss a value that changed in the next experiment? 

 

Kinda trying to figure out my BKM I guess.

 

P.S. Or maybe any other tips and tricks on how to go through a list of experiments?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to highlight cell if previous row is different (kinda conditional formatting in Excel)

There are a few different ways that you can do this.

  1. Use Select Duplicate Rows
    1. Select the target column you want to see the change in
    2. Click on the red triangle located at the top of the Row Stat(Row Number) column, and select
      1. Row Selection=>Select Duplicate Rows
      2. All rows, except the first row for each new value of your target column will be selected.  This may work perfectly for you,                                                                                                txnelson_0-1697850286139.png

         

        but is you want only the first row for each group selected, and the none of the secondary rows selected, you can Invert the Row Selection
        1. Go back to the red triangle and select
        2. Row Selection=>Invert Row Selection                           

txnelson_1-1697850631608.png

2. You can use the Column Property to set the color values for each different value of the target column, and when you do that, you can specify to "Color the Cell by Value"

txnelson_2-1697851033948.png

3. A simple script can color the cell where the value changes 

Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
	If( Row() == 1 | :Age != Lag( :age ),
		dt:age << color cells( "green", Row() )
	)
);

txnelson_3-1697851347140.png

I am sure there are other methods

 

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: How to highlight cell if previous row is different (kinda conditional formatting in Excel)

There are a few different ways that you can do this.

  1. Use Select Duplicate Rows
    1. Select the target column you want to see the change in
    2. Click on the red triangle located at the top of the Row Stat(Row Number) column, and select
      1. Row Selection=>Select Duplicate Rows
      2. All rows, except the first row for each new value of your target column will be selected.  This may work perfectly for you,                                                                                                txnelson_0-1697850286139.png

         

        but is you want only the first row for each group selected, and the none of the secondary rows selected, you can Invert the Row Selection
        1. Go back to the red triangle and select
        2. Row Selection=>Invert Row Selection                           

txnelson_1-1697850631608.png

2. You can use the Column Property to set the color values for each different value of the target column, and when you do that, you can specify to "Color the Cell by Value"

txnelson_2-1697851033948.png

3. A simple script can color the cell where the value changes 

Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
	If( Row() == 1 | :Age != Lag( :age ),
		dt:age << color cells( "green", Row() )
	)
);

txnelson_3-1697851347140.png

I am sure there are other methods

 

 

Jim
miguello
Level VI

Re: How to highlight cell if previous row is different (kinda conditional formatting in Excel)

Jim, 

 

The last solution is exactly what I need. For some reason I didn't realize you can color single cell, not the whole row using the same command