Forum Discussion
tallonland
Jul 07, 2023Copper Contributor
Conditional format blank cell based on how many days past date in another cell
I need to highlight a cell if it remains blank 1 day past date in another cell. For example: I3 has date of 15 May 23. J3 is blank. If today is past date in I3, and J3 is blank, then J3 turns red. If today is before date in I3, and J3 is blank,then J3 remains the color in the cell as shown in J5 with I5 date of 22 July 23 (that color is based on other conditional formats). If a date is entered into J3, then the red highlight is to be removed as shown in J4 (J4 has entry of 18 June 23).
Actually, how do you get the table that excludes blanks? I see Q5 just says '=LET(', but what does this mean and how does this know to reference Table 1?
If you increase the size of the formula bar you'll see that in Q5 the formula is (I updated it - feel free to re-download the sample I earlier shared):
=LET( n, F5, FilterCol, LAMBDA(col, LET(values, CHOOSECOLS(Table1,col), FILTER(values,ISNUMBER(values),FALSE))), StackCol, LAMBDA(init,col, HSTACK(init, TAKE(FilterCol(col),-n))), Array, IFNA(DROP(REDUCE("",SEQUENCE(COLUMNS(Table1)), StackCol),,1),FALSE), Array )
where you can see the 2 references to Table1
If you want to make it more obvious or for easier maintenance you can use:
=LET( myTable, Table1, n, F5, FilterCol, LAMBDA(col, LET(values, CHOOSECOLS(myTable,col), FILTER(values,ISNUMBER(values),FALSE))), StackCol, LAMBDA(init,col, HSTACK(init, TAKE(FilterCol(col),-n))), Array, IFNA(DROP(REDUCE("",SEQUENCE(COLUMNS(myTable)), StackCol),,1),FALSE), Array )