35

I want to format the whole row depending on if a particular cell in that is empty or not. I want conditional formatting to go through all rows and say add a background color if column C in that row is not empty.

How do I fix this?

pnuts
  • 58,317
  • 11
  • 87
  • 139
user3378720
  • 359
  • 1
  • 3
  • 3

5 Answers5

50

For illustration assuming "whole row" is ColumnsA:Z inclusive, please try Format - Conditional formatting..., Custom formula is:

=$C1<>""  

with formatting of your choice and Range: A:Z.

pnuts
  • 58,317
  • 11
  • 87
  • 139
  • 4
    This is the one that worked for me. My range was `A2:D999` so that it didn't include the title row. – jowie Apr 01 '15 at 11:38
  • https://support.google.com/docs/answer/78413?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cuse-custom-formulas-with-conditional-formatting – Dmitri R117 Aug 31 '21 at 20:07
11

I was able to do this by selecting the range I want the conditional formatting to apply to (for instance, A:P if you want to apply colour to columns A through P), and then selecting "Custom formula is" and adding =LEN($C:$C)>0. Then you just need to select the colour you want to apply.

JNat
  • 1,456
  • 4
  • 34
  • 37
1

The new Google Sheets can do some of this. Follow the instructions here: https://support.google.com/drive/answer/78413?hl=en

Summary: Format menu => Conditional formatting => "Text contains" drop down menu, select "Custom formula is" => Type "=isblank(C2)" => Add background color => Add range (like: A2:D2)

Although it does not solve completely the question, you will be able to define one rows color based on a cell's value.

Hope it helped.

P.s: While I was testing it I have encountered some bugs in this feature so it may very well happen that it won't be really useful. We'll see...

zolley
  • 6,030
  • 1
  • 14
  • 14
  • I got it to work for a selection by selecting the column you want the format applied to and enter in a formula like the following: =IF(ISBLANK($B2:B),false,true) << This means if the column B is not empty in that row, then the column I am formatting will become whatever format I wanted it to be. The ${COLNAM}:{COLNAME} format appears to suggest a range – cgseller Nov 20 '16 at 15:27
0

Adding to pnuts' solution, if you're skipping header rows you need to start the enumeration skipping them, as well.

For Example: If you're skipping 1 row, the new formula would be:

$C2<>""
ChadiW
  • 1
-1

Little late of an answer but hopefully it will help anyone searching:

=IF(a2="",false,true)

And select your range to format, with A2 being something in the range (not sure if this matters).

Works for conditional formatting.

Drake
  • 1