0

I'm trying to make a worksheet where I log shift hours.

I made columns with dates and to each date a row of hours

I want the date text to be green if in the same row a cell is not empty..

The code I used here apply only for column B and I don't know how to do it so the other columns applied as well =NOT(ISBLANK(B4:B43))

If possible.. I would also prefer to do it so I will not have to add any letters like - inside the cell but only color the cells

enter image description here

0

You can use conditional formatting that applies to your column range (All the dates). In my example this is A2:A6. Then I created the custom formula =COUNTA(B2:F2) to make sure a cell is colored when one or more cells in its corresponding row are not empty.

1 2

This solution is dependent on the cells not being blank so only colors won't work. Detecting if a cell has a specific color using the by default available functions is not possible as far as I know. You could however create a Google Apps Script script to use in the sheet. For this I recommend looking at Calculating shaded cells.

Personally I recommend just using the first approach as this is a lot easier.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.