Conditional Formatting

peterv6

Board Regular
Joined
May 16, 2005
Messages
129
Office Version
  1. 365
I am using EXCEL 2008.

I want to conditionally format the cells in column A depending on the values in the corresponding cells of a different columns, say columns B & C.

Column A would have dates.
Columns B & C would have number values representing hours and minutes in decimal form.

A B C
1/1/2022 0.50
1/2/2022 0.75
1/3/2022 1.50
1/4/2022 3.00
1/5/2022
1/6/2022 1.25
1/7/2022

If a cell in column A has a non-blank value in column B, I'd want the value in the cell in column A to be colored Green.
If a cell in column A has a non-blank value in column C, I'd want the value in the cell in column A to be colored Red.

If the values in both columns B & C are blank, I'd leave the formatting in the corresponding cell in column A the default color.

On an individual basis, I can do this using conditional formatting, but is there any way to apply this to an entire column?

I know how to do that with copy & paste for individual cells, but I can't figure out how to do it for an entire column based
on the cells in a corresponding column. If anyone can tell me if this is possible, and give me an idea how to do it, I'd be
eternally grateful. TIA
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I do not have such an old version to test with but this should still work.
I have assumed headings in row 1
  • Select from A2 down to the end of your data with A2 being the active cell.
  • Set up the CF rules as shown below. Excel will automatically adjust the row numbers as it applies the CF down the column.
22 01 29.xlsm
ABC
1DateVal 1Val 2
21/1/2022 0.5
31/2/2022 0.75
41/3/2022 1.5
51/4/2022 3
61/05/2022
71/6/2022 1.25
81/07/2022
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A8Expression=C2<>""textNO
A2:A8Expression=B2<>""textNO
 
Upvote 0
Solution
Hi,

What if Both B & C are non-blank?
 
Upvote 0
Hi,

What if Both B & C are non-blank?
Good question, but the calculations in my spreadsheet ensure that only one of the two columns would have a non-blank value. Thanks for pointing that out.
 
Upvote 0
Good question, but the calculations in my spreadsheet ensure that only one of the two columns would have a non-blank value. Thanks for pointing that out.

Then your question is answered in Post #2 by @Peter_SSs
 
Upvote 0
I do not have such an old version to test with but this should still work.
I have assumed headings in row 1
  • Select from A2 down to the end of your data with A2 being the active cell.
  • Set up the CF rules as shown below. Excel will automatically adjust the row numbers as it applies the CF down the column.
22 01 29.xlsm
ABC
1DateVal 1Val 2
21/1/2022 0.5
31/2/2022 0.75
41/3/2022 1.5
51/4/2022 3
61/05/2022
71/6/2022 1.25
81/07/2022
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A8Expression=C2<>""textNO
A2:A8Expression=B2<>""textNO
This looks like a good solution, unfortunately, Excel 2008 doesn't have this capability. The only options it gives is "cell value is" or "formula is".
I'm no longer in it, and it wouldn't be cost effective to upgrade, unfortunately. Thanks anyway.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

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