# Color row

#### sccson

##### New Member
Hello,

Is there a way to color an entire row based on the color of the cell next to it?

I used conditional formatting on a cell based on a value, but I also need to color the cell next to it (it does not have a value), the cell has a name.

Name Total

John Smith 40

Based on the total the entire row should be
Red. The numbers - 0 - 4 green, 5 to 8
yellow, 5 to 12 orange 13 and up is red

Thank you

### Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You can use the same conditional format using formula is.. just apply it to all cells in the row

EXAMPLE:

Conditional Format

Formula is:
=\$A1=40

Apply that conditional format to all cells in row 1.
If A1 = 40 the entire row will format as you specify.

I see, the problem is that the "name cell already has a formula (=Sheet1!B1). How can add to it?

Also, the number is always a variable.

Thank you

The only thing you are changing in the name column is the conditional formats.... not the formula in the cell.

You can enter three 'Conditions'

Formula is: =\$B1<=4 format green
Formula is: =AND(\$B1>=5,\$B1<=8) format yellow
Formula is: =\$B1>=13 format orange

By locking the B you can copy that format to all cells in your sheet and the conditional format will work for the entire row based on the value of what is in column B.

It's been a long day. I don't understand how to add / enter formula

Sorry

Highlight the range where you want the rows colored according to the data in column B (totals). A1:D236 (or whatever).

Then goto Format on the toolbar / Conditional Formatting.
Change the drop down box that currently says "Cell Value Is" to "Formula Is"
In the box to the right type this formula:
=\$B1<=4
Choose the format you want for totals less than or equal to 4.
Do the above for Condition 2 using this formula:
=AND(\$B1>=5,\$B1<=8)
Choose the format you want for totals greater than or equal to 5 and less than or equal to 8.
Do the above for Condition 3 using this formula:
=\$B1>=13
Choose the format you want for totals greater than or equal to 13.

You are entering the formula in the conditional format... not on the worksheet. By choosing an entire range and only locking '\$' the Column in the conditional format formula... each cell in the row will look to the total to see what color it should be.

Thank you, for the help. I was having problems with it working properly at first, but after I added =IF in the first condition, it seems to work.

Thanks again for the help.

Mike

However you shouldn't need the 'IF' in a conditional format as it is implied.

Replies
4
Views
268
Replies
2
Views
478
Replies
1
Views
92
Replies
7
Views
497
Replies
5
Views
281

1,214,436
Messages
6,119,515
Members
448,903
Latest member
StephMJ

### 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.

### Which adblocker are you using?

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

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