Forum Discussion
brianclarke
Jan 27, 2024Copper Contributor
Conditional formatting - changing color/pattern based on a simple "greater than" condition
I'm simply trying to change a cell's color based on whether its number value is greater than an adjacent cell's value:
- May 24, 2023You can use an IF statement to check if the neighboring column contains a date, and then perform the calculation accordingly.
Assuming your "Date off (Day 0)" column is column H and your "Expiry Date" column is column I, you can use the following formula in cell I2:
=IF(ISDATE(H2), H2+5, "")
This formula uses the ISDATE function to check if the cell in column H contains a date. If it does, it adds 5 days to the date in column H (H2+5). If the cell in column H does not contain a date, the formula returns an empty string ("").
You can drag the formula down the column to apply it to the other cells in column I.
The formula will only calculate a result when the corresponding cell in column H is populated with a date.
Otherwise, it will leave the cell in column I blank.
Please adjust the column references and formula as needed based on your specific worksheet layout.
OliverScheurich
Jan 27, 2024Gold Contributor
- brianclarkeJan 27, 2024Copper Contributor