1
votes

I'm trying to format the rows within my google sheets in a very specific way.

I have multiple rows with a date on the left. I run conditional formatting and have the entire row colored.

I use the following custom formula: =$B4=today()

Now I'd like to include the sub-rows where the farthest left column is empty.

Let's say today's the 3.1.19. The number of sub-rows can vary (from none to up to 10). I have an example of how it should look like below:

+---------+----------+---------+---------+
| 1.1.19  | cell 1   | cell 2  | cell 3  |
|         | cell 1   | cell 2  | cell 3  |
| 2.1.19  | cell 1   | cell 2  | cell 3  |
| 3.1.19  | cell 1   | cell 2  | cell 3  | <- colored right now
|         | cell 1   | cell 2  | cell 3  | <- should be colored too
|         | cell 1   | cell 2  | cell 3  | <- should be colored too
|         | cell 1   | cell 2  | cell 3  | <- should be colored too
| 4.1.19  | cell 1   | cell 2  | cell 3  |
+---------+----------+---------+---------+
2

2 Answers

1
votes
=IF(TODAY()=TO_DATE(IF(LEN(B1), 
 VLOOKUP(ROW(A1), FILTER({ROW(A:A), A:A}, LEN(A:A)), 2), )), 1)

0

0
votes

Suppose you have dates in B column, starting from B1. Then in conditional formatting you can apply the formula:

=INDEX(FILTER($B$1:$B1; NOT(ISBLANK($B$1:$B1)));ROWS(FILTER($B$1:$B1; NOT(ISBLANK($B$1:$B1)))))=TODAY()

You can apply it to entire rows.