简体   繁体   中英

Change background color of more than one cell on the same row when another cell has a certain numeric value in Excel 2010

    A        B        C        D

1   Name     2009     2010     Total
2   Sam      400      600      1000
3   John     200      400      600
4   Eric     100      300      400

I'm working on a simple list (see example above) where a cells background color changes (in a simple traffic light system) in both the Total (column D) and Name (column A) when the cell value in D has certain numeric values, that is:

  • Green if total >=1000
  • Amber is between 500-999
  • Red <500

I've used a conditional formatting sequence using MS Excel 2010 to highlight cells in D. However, how do i create a sequence or code so that the corresponding cell in A of the same row is colored the same way? For example, if D2 is Green then I want A2 to be Green as well?

How do i do this?

1.Select Cell A2

2.Click Conditional Formatting>Manage Rules>New Rule>'Use a formula to determine which cells to format'

3i)Enter formula =D2>=1000 and set format to green fill

3ii)Click New Rule>'Use a formula to determine which cells to format' and enter =AND(D2<=999,D2>=500) and selecter format as amber fill

3iii)Click New Rule>'Use a formula to determine which cells to format' and enter =D2<500 and set format to red fill

4.Click Ok

5.Copy Cell A2 and paste formats down to A3:Ax

6.Repeat steps 1 - 5 above but use cell D2 instead of A2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM