ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to change a color of cell 2a to blue if 2b contains a value? (https://www.excelbanter.com/excel-worksheet-functions/53780-how-change-color-cell-2a-blue-if-2b-contains-value.html)

Jon

how to change a color of cell 2a to blue if 2b contains a value?
 
If a cell contains any value I want a particular cell to change to a
different color.

Max

how to change a color of cell 2a to blue if 2b contains a value?
 
Taking the details from your subject line:

Select A2
Click Format Conditional Formatting
Under condition 1, make the settings:
Formula is: =B2<""
Click Format button Patterns tab Blue OK
Click OK at the main dialog

And, depending on how 'blank' is defined, alternative conditional format
formulae which could be used (from a recent post by Harlan):
=NOT(ISBLANK(B2))
or equivalently
=COUNTA(B2)
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Jon" wrote in message
...
If a cell contains any value I want a particular cell to change to a
different color.




B. R.Ramachandran

how to change a color of cell 2a to blue if 2b contains a value?
 
Hi,

Use 'Conditional Formatting'.

If B2 will contain only numerical values, do the following.
Click on A2, then "Format" (in the Toolbar) -- "Conditional Formatting" --
under 'Condition 1' change to "Formula Is" -- in the formula bar enter
=COUNT($B$2) -- click on the "Format" button -- "Patterns" Tab -- Select
the Blue color -- "OK" -- "OK"

An alternative formula that will also work is =ISNUMBER($B$2)

The above formula will color the cell A2 to blue if B2 contains a numerical
value (including zero); A2 will not be turn color if B2 is empty or contains
text.

If you want A2 to get colored when B2 contains any type of data (number or
text),
change the conditional-formatting formula as =COUNTA($B$2)
Please note however that even a space character (which you can't see) if
present in B2 will color A2 to blue.

Regards,
B. R. Ramachandran

"Jon" wrote:

If a cell contains any value I want a particular cell to change to a
different color.



All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com