{"id":15647,"date":"2023-05-10T16:27:30","date_gmt":"2023-05-10T16:27:30","guid":{"rendered":"https:\/\/officetuts.net\/excel\/?p=15647"},"modified":"2024-03-26T10:56:28","modified_gmt":"2024-03-26T10:56:28","slug":"conditional-formatting-based-on-date-in-excel","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/","title":{"rendered":"Conditional Formatting Based on Date in Excel"},"content":{"rendered":"\n
Conditional-Formatting-Based-on-Date-in-Excel<\/a>Download File<\/a><\/div>\n\n\n\n

Conditional Formatting<\/strong> is one of the best tools that can help us to highlight our cells and help us visually represent our data.<\/p>\n\n\n\n

Formatting can be determined by many factors, such as range, value, a specific text, or even a date. In the example below, we will show the latest formatting option we mentioned- formatting by a date<\/strong>.<\/p>\n\n\n\n

Conditional Formatting with Date Occurring<\/h2>\n\n\n\n

For our example, we need data that will have actual dates<\/strong>. We will use the table with sales figures<\/strong> and the dates when they were achieved<\/strong>:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

These dates are in the span of two months before the date this article was written (7th of May, 2023).<\/strong> To find out which sales were made in the previous month, we can either use a formula (subtract today\u2019s date by 30)<\/strong> or highlight these cells with Conditional<\/strong> Formatting<\/strong>.<\/p>\n\n\n\n

To do the latter, we will go to Home tab >> Styles >> Conditional Formatting >> Highlight Cells Rules >> A Date Occurring:<\/strong><\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Once clicked, the window for formatting will appear. In this window, we will choose Last month under Format cells that contain a date occurring<\/strong>, and we will choose the formatting option in a dropdown on the right side<\/strong> (in our case- Light Red Fill with Dark Red Text<\/strong>):<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Since we chose Last month<\/strong>, only the dates of sales that refer to the last month will be highlighted.<\/p>\n\n\n\n

The problem, or the good thing with this formula, depending on how you look at it, is that it calculates the date based on today\u2019s date, so our highlighted cells can change as today\u2019s date changes.<\/p>\n\n\n\n

Conditional Formatting with New Rules<\/h2>\n\n\n\n

We can use fixed formatting for dates as well. To do this, we will select our range, then go to the Home Tab >> Styles >> Conditional Formatting >> New Rule<\/strong>:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Under the window that appears, in Select a Rule Type<\/strong> we will choose Use a formula<\/strong> to determine which cells to forma<\/strong>t option. Under that option, in Edit the Rule Description<\/strong>, we will insert the formula:<\/p>\n\n\n\n

=AND(B2>=DATE(2023,3,1),B2<=DATE(2023,3,31))<\/code><\/pre>\n\n\n\n
\"\"<\/figure>\n\n\n\n

This formula will encompass all the dates in March (higher or equal to March 1st, and lower or equal to 31st of March)<\/strong>. We need to format these cells as well, and we will do that by clicking on the Format<\/strong>, and then going to the Fill tab<\/strong> and choosing the color (in our case, light blue<\/strong>):<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

We will click OK twice<\/strong>, and will have our results presented in the table:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

With the second formula, we have made our rule static<\/strong>, which will always highlight the dates we set.<\/p>\n","protected":false},"excerpt":{"rendered":"

Conditional Formatting is one of the best tools that can help us to highlight our cells and help us visually represent our data….<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[170,190],"yoast_head":"\nConditional Formatting Based on Date in Excel<\/title>\n<meta name=\"description\" content=\"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Conditional Formatting Based on Date in Excel\" \/>\n<meta property=\"og:description\" content=\"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-10T16:27:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-26T10:56:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png\" \/>\n<meta name=\"author\" content=\"Harun Spahic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Harun Spahic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\"},\"author\":{\"name\":\"Harun Spahic\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\"},\"headline\":\"Conditional Formatting Based on Date in Excel\",\"datePublished\":\"2023-05-10T16:27:30+00:00\",\"dateModified\":\"2024-03-26T10:56:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\"},\"wordCount\":443,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png\",\"keywords\":[\"file\",\"pinterest\"],\"articleSection\":[\"examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\",\"url\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\",\"name\":\"Conditional Formatting Based on Date in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png\",\"datePublished\":\"2023-05-10T16:27:30+00:00\",\"dateModified\":\"2024-03-26T10:56:28+00:00\",\"description\":\"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png\",\"width\":227,\"height\":293},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Conditional Formatting Based on Date in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\",\"name\":\"Harun Spahic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"caption\":\"Harun Spahic\"},\"sameAs\":[\"http:\/\/human.bsru.ac.th\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Conditional Formatting Based on Date in Excel","description":"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/","og_locale":"en_US","og_type":"article","og_title":"Conditional Formatting Based on Date in Excel","og_description":"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!","og_url":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/","article_published_time":"2023-05-10T16:27:30+00:00","article_modified_time":"2024-03-26T10:56:28+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png"}],"author":"Harun Spahic","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Harun Spahic","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/"},"author":{"name":"Harun Spahic","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2"},"headline":"Conditional Formatting Based on Date in Excel","datePublished":"2023-05-10T16:27:30+00:00","dateModified":"2024-03-26T10:56:28+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/"},"wordCount":443,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png","keywords":["file","pinterest"],"articleSection":["examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/","url":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/","name":"Conditional Formatting Based on Date in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png","datePublished":"2023-05-10T16:27:30+00:00","dateModified":"2024-03-26T10:56:28+00:00","description":"Highlight cells that contain a date occurring in the previous month with ease using Conditional Formatting. Download the example file now!","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/word-image-15647-1.png","width":227,"height":293},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/examples\/conditional-formatting-based-on-date-in-excel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Conditional Formatting Based on Date in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."},{"@type":"Person","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2","name":"Harun Spahic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","caption":"Harun Spahic"},"sameAs":["http:\/\/human.bsru.ac.th\/"]}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15647"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=15647"}],"version-history":[{"count":2,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15647\/revisions"}],"predecessor-version":[{"id":15657,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15647\/revisions\/15657"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=15647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=15647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=15647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}