Home > Mobile >  Excel: compare every other row with the one below and colorize cells if the value is greater
Excel: compare every other row with the one below and colorize cells if the value is greater

Time:02-16

Consider the following data -

enter image description here

I want to compare every other row with the one below and colorize the cells if the value is greater as shown in the image.

If at all the data is sorted on some column, the colored cells should remain as they were initially. For example, the comparison should be between values A and B in COL1 for the same value ALPHA in COL2.

Can this be achieved by writing a formula and how it would look like? Thanks SO.

CodePudding user response:

Conditional Formatting formula, applied to C2 (select C2 when creating the CF rule

=AND(MOD(ROW(), 2)=0, C2>OFFSET(C2,1,0))

Apply to your data block

enter image description here

  • Related