SharePoint list conditional formatting based on a date

In this SharePoint Online tutorial, we will discuss what is conditional formatting in SharePoint online list, how to apply conditional formatting based on the date in SharePoint online list, and also how to delete conditional formatting based on a date in SharePoint online list.

What is Conditional formatting in a SharePoint Online list?

Conditional formatting allows us to define rows, that will change the appearance of a SharePoint list column based on conditions where it making easy to highlight certain values.

Example: We have created a list for RENA Technologies, a company based out in the United States of America. Based on the business scenario, the client stored Semiconductor Issue Tracker list in SharePoint Online. We stored information like:

  • Issue ID
  • Issue
  • Issue Description
  • Issue Image
  • Issue Status
  • Issue Assigned to
  • Issue Start Date
  • Issue Resolved Date

We already have a Date and time type, columns as Issue Start Date and Issue Resolved Date, so we will create a Conditional format to Issue Start Date like when the Issue started before this year if yes then we can highlight or color code and displays the list items that are presented in the list. Also, we can give Issue Start Date as between today and a particular date by giving conditions. We will see how to give conditions in the next process.

SharePoint list conditional formatting based on a date

For creating a Conditional format based on date, we should have a Date and time type column in our SharePoint list.

There are two different ways to create Conditional formatting based on the date, they are:

  • Create Conditional formatting based on the date using column settings.
  • Create Conditional formatting based on the date using Format current view.

Create Conditional formatting based on a date using column settings

We will see how to create a conditional formatting based on the date using column settings in a SharePoint Online modern list.

  • Open your SharePoint Online that you have created with the Date and time type column, else Navigate to https://<tenantname>.sharepoint.com/sites/<sitename> /Lists/<listname>. Example:https://tsinfotechnologies.sharepoint.com/sites/RenaTechnologies/Lists/SemiconductorIssueTracker
  • Then, click on the column, of Date and time type -> Select Column settings. Example: Issue Start Date
SharePoint list conditional formatting based on a date
SharePoint list conditional formatting based on a date
  • It Expands with a dialog box, click on the Format this column
SharePoint Online list conditional formatting based on a date
SharePoint Online list conditional formatting based on a date
  • In Format columns, Choose Conditional Formatting and on the same Conditional formatting click on the Manage rules as shown below:
How to create a conditional formatting based on date in SharePoint list
How to create a conditional formatting based on the date in the SharePoint list
  • A dialog box appears with Conditional formatting, we will explain with some examples for adding rules:-
  • Case 1: click on the +Add rule
How to create a conditional formatting based on date in SharePoint Online list
How to create a conditional formatting based on the date in the SharePoint Online list
  • Now we will create a rule by if condition, IF:
    • Choose a column: we need to choose a column in which we create a rule. Example: We will choose Issue Start Date
    • Choose a Comparison: we will use a comparison of whether the column is equal to, before, not equal to, etc. Example: We will choose is before
    • Choose a type or value: We need to choose between, Today or A Specific date. Example We will choose A Specific date -> Select a date in calendar(Jan/01/2023)
Conditional format based on a date using SharePoint list
Conditional format based on a date using SharePoint list
  • Show list item as:- We can set a color based on our requirement.
  • Now we can see the applied condition based on a date, that the IssueStartDate column has color-coded based on the is before comparison with the 1/1/2023 date and displays the list item as highlighted as shown below:
Add conditional formatting based on a date in SharePoint online list
Add conditional formatting based on a date in SharePoint online list
  • Case 2: Now we will add another rule, Click on the +Add rule, here we can add another rule. (Optional)
Conditional format based on a date in SharePoint list
Conditional format based on a date in SharePoint list
  • Now we will create a rule by if condition:
    • Choose a column: we need to choose a column in which we create a rule. Example: We will choose the Issue Start Date
    • Choose a Comparison: we will use a comparison of whether the column is equal to, before, not equal to, etc. Example: We will choose is between
    • Choose a type or value: We need to choose both between, Today and A Specific date. Example: We will choose Today and A specific date -> Select a date in calendar(April/27/2023)
Conditional format based on a date in SharePoint Online list
Conditional format based on a date in SharePoint Online list
  • Show list item as:- We can set a color based on our requirement.
  • Click on the Save Button.
  • Now we can see the applied condition based on a date, that the IssueStartDate column has color-coded based on the is between comparison with the today date and 4/27/2023 date and displays the list item as highlighted as shown below:
conditional formatting to a date column in a SharePoint Online list example
conditional formatting to a date column in a SharePoint Online list example

In the below screenshot, we can find that, we have created two conditions with a comparison of is before and is between of Issue Start Date column

Add conditional formatting based on a date in SharePoint list
Add conditional formatting based on a date in the SharePoint list
  • We have applied both the conditions above that are based on a date. Here the IssueStartDate column has color-coded based on the comparison of is before and is between comparison displays the SharePoint Online list item as highlighted as shown below:
conditional formatting to a date column in SharePoint list example
conditional formatting to a date column in the SharePoint list example

This is how to create conditional formatting based on the date using SharePoint Online list column settings.

Create SharePoint List Conditional formatting based on the date using Format current view

We will see how to create a SharePoint list conditional formatting based on the date using the Format current view

  • Open your SharePoint Online that you have created with the Date and time type column, else Navigate to https://<tenantname>.sharepoint.com/sites/<sitename> /Lists/<listname>. Example:https://tsinfotechnologies.sharepoint.com/sites/RenaTechnologies/Lists/SemiconductorIssueTracker
  • Now expand the All items drop down and click on the Format current view
Add a conditional formatting based on a date in SharePoint online list
Add conditional formatting based on a date in SharePoint online list
  • In Format view, Choose Conditional Formatting, and on the same Conditional formatting click on the Manage rules as shown below:
SharePoint list conditional formatting based on a date example
SharePoint list conditional formatting based on a date example
  • A dialog box appears with Conditional formatting, click on the +Add rule
SharePoint online list conditional formatting based on a date example
SharePoint Online list conditional formatting based on a date example
  • Now we will create a rule by if condition, IF:
    • Choose a column: we need to choose a column in which we create a rule. Example: We will choose Issue Start Date
    • Choose a Comparison: we will use a comparison of whether the column is equal to, before, not equal to, etc. Example: We will choose is after
    • Choose a type or value: We need to choose between, Today or A Specific date. Example We will choose A Specific date -> Select a date in calendar(Jan/01/2023)
How to create a conditional formatting based on date in SharePoint list example
How to create a conditional formatting based on the date in the SharePoint list example
  • Show list item as:- We can set a color based on our requirement.
  • Now we can see the applied condition based on a date, that the IssueStartDate column has color-coded based on the is before comparison with the 1/1/2023 date and displays the list item as highlighted as shown below:
Add conditional formatting to a date column in a SharePoint Online list example
Add conditional formatting to a date column in a SharePoint Online list example

This is how we can create Conditional formatting based on the date using the Format current view

How to delete the SharePoint list conditional formatting based on a date?

We already applied the conditional format based on the date in the above examples. We will see how to delete conditional formatting from the SharePoint Online list.

  • Click on the column, to which you applied the conditional format of Date and time type, -> Select Column settings. Example: Issue Start Date
  • It Expands with a dialog box, click on the Format this column
  • In Format columns, Choose Conditional Formatting and on the same Conditional formatting click on the Manage rules.
  • A dialog box appears with Conditional formatting, where we applied the condition -> click on the color based as shown below:
Example of conditional format based on a date using SharePoint list
Example of conditional format based on a date using SharePoint list
  • Click on the No styles.
Example of conditional format based on a date using SharePoint online list
Example of conditional format based on a date using SharePoint online list
  • Then, Click on the more options(…), as shown below:
Example how to create a conditional formatting based on date in SharePoint list
Example how to create a conditional formatting based on the date in the SharePoint list
  • Click on the delete rule.
Example of how to create a conditional formatting based on date in SharePoint online list
Example of how to create a conditional formatting based on the date in SharePoint online list
  • Then, click on the Save button. Now we can see the applied condition is deleted based on a date, that the IssueStartDate column has color-coded based on the comparison as shown below:
conditional formatting to a date column in a modern SharePoint list
conditional formatting to a date column in a modern SharePoint list

This is how we can delete the conditional formatting based on a date in a SharePoint Online list.

Conclusion

In this SharePoint Online Tutorial, we discussed what is conditional formatting in SharePoint online list, how to create Conditional formatting based on the date in SharePoint online list, and also how to delete conditional formatting based on a date in SharePoint online list.

You may also like: