Excel - Shading entire row based on change of value

后端 未结 11 1832
一生所求
一生所求 2020-12-23 20:05

I would like to shade entire rows in Excel based on the value of one cell. For example say I have the rows below:

**File No**
1122
1122
1144
1155
1155
1155
         


        
11条回答
  •  盖世英雄少女心
    2020-12-23 20:13

    I had to do something similar for my users, with a small variant that they want to have a running number grouping the similar items. Thought I'd share it here.

    • Make a new column A
    • Assuming the first row of data is in row 2 (row 1 being header), put 1 in A2
    • Assuming your File No is in column B, in the second row (in this case A3) make the formula =IF(B3=B2,A2,A2+1)
    • Fill/copy-paste cell A3 down the column to the last row (be careful not to copy A2 by accident; that will populate all cells with 1)
    • Select the data range
    • In the Home ribbon select Conditional Formatting -> New Rule
    • Choose Use a formula to determine which cells to format
    • In the formula cell, put =MOD($A1, 2)=1 as the formula
    • Click Format, select the Fill tab
    • Select the Background Color you want, then click OK
    • Click OK

    enter image description here

提交回复
热议问题