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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If a cell contains any value I want a particular cell to change to a
different color.
 
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)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top