Forum Discussion
Abbie0975
Aug 15, 2023Copper Contributor
Conditional formatting based on dates
If I have a ‘received date’ in column B and a ‘completed date’ in Column D and want column E to turn green if the completed date was within 7 days and red if over 7 days, what formula do I use? Thank you.
- JKPieterseSilver Contributor
- Select the cells in col E
- Choose Conditional format, New Rule
- Select "Use formula to determine..."
- Enter this formula (assuming your data starts on row 2):
=D2-C2<=7 - Click Format and set a green fill.
Do these same steps for over 7 days, change the formula to D2-C2>7 and set a red fill
- Abbie0975Copper Contributor
JKPieterse thank you so much, I will give it a try.
I also have a colum calculating the number of days between received and completed, do you know if there’s a formula I can use to calculate the overall percentage that are within the 7 days? Thank you again.Let's say the number of days can be found in G2:G50.
Enter the following formula in a cell and format it as a percentage:
=COUNTIF(G2:G50, "<=7")/COUNT(G2:G50)