{"id":5796,"date":"2021-05-28T08:02:43","date_gmt":"2021-05-28T08:02:43","guid":{"rendered":"https:\/\/davelevy.info\/wiki\/?p=5796"},"modified":"2021-05-28T08:03:45","modified_gmt":"2021-05-28T08:03:45","slug":"datediff-in-excel","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/datediff-in-excel\/","title":{"rendered":"Datediff in Excel"},"content":{"rendered":"<p>Another article on Excel idioms; this one&#8217;s about dates. It&#8217;ll be useful for some.<!--more--><\/p>\n<p>I want to create a number of frequency charts of a series of dates. Date arithmetic is notoriously hard and will rely on functions.<\/p>\n<p>Here&#8217;s two ways of calculating the difference in years between a date and today, i.e. how old in years is this event?<\/p>\n<p>=INT(YEAR(TODAY())-YEAR(eventdate))<\/p>\n<p>=ROUNDDOWN(YEARFRAC(eventdate,TODAY(),1),0)<\/p>\n<p>Featured Image:\u00a0 <a href=\"https:\/\/www.flickr.com\/photos\/pedrosz\/3911806960\/\">from flickr, by Pedro Szeleky<\/a>\u00a0CC 2009 BY-NC-SA (This is cropped and shrunk.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another article on Excel idioms; this one&#8217;s about dates. It&#8217;ll be useful for some.<\/p>\n","protected":false},"author":1,"featured_media":5797,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[3],"tags":[1637,156,1636,1638],"class_list":["post-5796","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-datediff","tag-excel","tag-techynology","tag-yearfrac"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/05\/prague-clock-cc-by-nc-sa.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/5796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=5796"}],"version-history":[{"count":0,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/5796\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/5797"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=5796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=5796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=5796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}