Share via

Help with conditional formatting for a date.

Anonymous
2024-07-03T14:45:36+00:00

I have a sheet with a a cell (G2) that contains due date in form DD/MM/YYYY, I want to highlight this cell based on two conditions, G2 being less that 5 days away (or the past) and L2 not containing any text. Is this possible.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Rich~M 20,370 Reputation points Volunteer Moderator
2024-07-03T15:04:21+00:00

Hi Dave.

Here is the procedure to add the Conditional Formatting you want.

  1. Select all of the cells that you want to format. I used G2:G15 in the screenshot below. You can also include additional columns if desired.
  2. On the Home ribbon in the Styles section, select Conditional Formatting>New Rule>Use a Formula.
  3. In the Format Values line enter this formula.

=AND($G2-5<TODAY(),$L2="")

  1. Click on the format button at the lower right of the dialogue window and set the formatting you want from the Format Cells dialogue. Then press OK and OK.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Rich~M 20,370 Reputation points Volunteer Moderator
    2024-07-03T16:59:54+00:00

    Here is the formula to add that condition. However, I wasn't sure whether it should be formatted if H2 is "No" or shouldn't be. Check this with cells formatted if H2 is "No".

    =AND($G2-5<TODAY(),H2="No",$L2="")

    If that is backwards and they should not be formatted if H2 is "No" then use this.

    =AND($G2-5<TODAY(),H2<>"No",$L2="")

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-07-03T15:50:53+00:00

    Amazing thank you, Sorry, and if i also wanted to add a condition that cell h2 should = "No" ?

    Was this answer helpful?

    0 comments No comments
  3. Rich~M 20,370 Reputation points Volunteer Moderator
    2024-07-03T15:13:31+00:00

    Just a note. I got the first formula backwards so I edited the post. Make sure you are looking at the current one.

    Was this answer helpful?

    0 comments No comments