Color more than one cell on the same row when a cell has a certain numeric value

dvp

New Member
Joined
May 2, 2011
Messages
23
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, ie 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, D2 is Green, and i want A2 to be Green as well? How do i do this?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
In conditional format dialog box enter formula below as 3 seperate conditions and format as disired
Excel Workbook
ABCDEF
1Name20092010Total
2Sam4006001000=$D2>=1000
3John200400600=AND($D2>=500,$D2
4Eric100300400=$D2
Sheet
 
Last edited:
Upvote 0
Thanks for your replies VOG and fromspenny, i did find some information similar to yours which highlights the whole row. What i wanted to know is if its possible to highlight just columns A and D, and not include B and C?
 
Upvote 0
You can select columns A and D then apply Conditional Formatting using formulas like


=$D2>=1000
 
Upvote 0
Thanks for your replies VOG and fromspenny, i did find some information similar to yours which highlights the whole row. What i wanted to know is if its possible to highlight just columns A and D, and not include B and C?

Highlight a2:a4 and d2:d4 and apply formulas from above


Excel Workbook
ABCD
1Name20092010Total
2Sam4006001000
3John200400600
4Eric100300400
Sheet1
 
Upvote 0
Thats worked a treat, thank you very much. I've applied it to my actual excel file, and both sets of cells are highlighted. One small problem, some of the totals do not highlight in the right color.

For example, i've set up conditional formatting for:

Green: =$D2>=100000
Orange: =AND($D2>=50000,$D2<100000)
Red: =$D2<50000

A total of 99,447.68, which should be orange but appears as green.

Why would this happen?
 
Upvote 0
Thats worked a treat, thank you very much. I've applied it to my actual excel file, and both sets of cells are highlighted. One small problem, some of the totals do not highlight in the right color.

For example, i've set up conditional formatting for:

Green: =$D2>=100000
Orange: =AND($D2>=50000,$D2<100000)
Red: =$D2<50000

A total of 99,447.68, which should be orange but appears as green.

Why would this happen?

Check your figures are correct as the formatting works perfect for me

Excel Workbook
ABCDEFGHI
1Name20092010Total
2Sam400.00100,000.00100,400.00TRUEFALSEFALSE=$D2>100000
3John50,000.0049,447.6899,447.68FALSETRUEFALSE= AND($D2>=50000,$D2
4Harry100.00300.00400.00FALSEFALSETRUE=$D2
5James16,533.3347,000.0063,533.33FALSETRUEFALSE
6John50,000.0020,000.0070,000.00FALSETRUEFALSE
7Kenny20,000.0040,000.0060,000.00FALSETRUEFALSE
8Lyn20,000.0085,000.00105,000.00TRUEFALSEFALSE
9Fred80,000.001,000.0081,000.00FALSETRUEFALSE
10William25,000.0026,000.0051,000.00FALSETRUEFALSE
11Sue49,447.6850,000.0099,447.68FALSETRUEFALSE
12Dan15,483.3320,000.0035,483.33FALSEFALSETRUE
13Abbie15,333.3310,000.0025,333.33FALSEFALSETRUE
Sheet1
 
Upvote 0
Thanks very much once again, i found the problem which was one of the cell numbers in the array was incorrect, works a treat!
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top