Google-sheets – Format a cell in bold if its row has other nonempty cells

conditional formattinggoogle sheets

I'm looking to format a Google Spreadsheet with something beyond the "basic" Conditional Formatting they offer. From what I understand, this must be done using a Google Apps Script. I've found one example of this, but I have no idea how to modify the script I found here to do what I'd like to do.

All I'm looking to do is to bold any cells in Column A if that cell's row is not blank. For example: Cell F7 is not blank, so the text in Cell A7 becomes bold.

I tried something like this in Cell A9 for a single row (row 9 in this case),

=IF(!isblank(B9:Z9),BOLD)

but it did not work. And if it did work, it would not allow me to also keep Cell A9's contents.

Could anyone help me out here? Or point me to a good resource that I can help myself with?

Best Answer

You don't need a script for that; the built-in conditional formatting tools are flexible enough. Assuming the first row is for headers, apply conditional formatting to the range A2:A, with custom formula =len(join("", B2:Z2)). This means: join the content of cells, and find its length; the formatting applies if the length is greater than 0.

Replace Z by AZ or something else if you have more columns. (The formula will automatically adjust if you insert more columns between A and Z later.)

Bold formatting is found in the formatting dropdown, select "Custom" as below.

example