# Conditional Format cells based on a value within the row

#### ddander54

##### Board Regular
Is there a formula I can use in Conditional Formatting to highlight specific cells (not the row) based on the text in one cell in the row to highlight the data in the same row? Currently I'm creating 3 CF's (">0", "=0', "<0") in the specific row of data, then using the Format Painter to copy the format to the next row where the 'condition' occurs. There are now a thousand rows, so the Format Painter is a little too much on a daily basis.

My 'condition' is in Column D (starts at D8 is the text "Available Capacity"), My data to highlight is in Columns F:Q (F8:Q8)...Green fill if ">0", Yellow fill if "=0", Red fill if "<0".
So my data looks like this:
Col C | Col D | Col F | Col G | Col H.......
John | blank | blank | blank | blank.....
John | Total Capacity | 132 | 148 | 156.....
John | Total Assignments | 100 | 152 | 156
John | Available Capacity | 32 | -4 | 0
Suzy | blank | blank | bank | blank
Suzy | Total Capacity | 148 | 150 | 132
Suzy | Total Assignments | 148 | 148 | 152
Suzy | Available Capacity | 0 | 2 | -20

Or is this just a job for VBA?

Thanks,
Don

### Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

#### Joe4

Select the whole range that you want to apply it to, then write the formula as it applies to the very first cell in your selection.
Provided that you use the proper mix of absolute/relative range references, Excel will automatically adjust the formula for all the other cells (just like when you copy a formula down or across).

#### Fluff

##### MrExcel MVP, Moderator
Highlight the data you want to work on, say F2:H10 & use this formula
=AND(\$D2="Available Capacity",F2<0) for the red

#### ddander54

##### Board Regular
Joe4, Fluff,

For some reason when I previously tried the =AND.... formula I wasn't able to get it to work. It works like it should now.

Don

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback

Replies
1
Views
126
Replies
1
Views
242
Replies
3
Views
210
Replies
6
Views
60
Replies
4
Views
485

1,128,117
Messages
5,628,793
Members
416,340
Latest member
PJB1102

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