{"id":5665,"date":"2017-03-25T21:29:54","date_gmt":"2017-03-26T04:29:54","guid":{"rendered":"http:\/\/www.vincentfung.ca\/blog\/?p=5665"},"modified":"2017-03-25T21:30:36","modified_gmt":"2017-03-26T04:30:36","slug":"i-always-forget-how-to-convert-simple-text-strings-into-dates-in-excel","status":"publish","type":"post","link":"https:\/\/www.vincentfung.ca\/blog\/archives\/5665","title":{"rendered":"I always forget how to convert simple text strings into dates in&nbsp;Excel"},"content":{"rendered":"<p>Despite having the world&#8217;s knowledge at my finger tips (i.e. the internet), I always forget little tips on how to do things in Excel. Yes, there&#8217;s bookmarks and other different ways to save websites, but I can never find them again after I saved them! So maybe writing a blog about it might be a good way to remember and also to help other people out there who come across this same problem.<\/p>\n<p>This is one of the most annoying things when working with text and numbers in Excel&#8230; getting text to be in a &#8220;date&#8221; format. It makes life a whole lot easier when running queries or trying to sort\/filter\/order numerical values rather than text. While there are a lot of ways to do it (<a href=\"https:\/\/www.ablebits.com\/office-addins-blog\/2015\/03\/26\/excel-convert-text-date\/\">see this link for example<\/a>), the following method is the most straight-forward way for me to convert text into a date\/number and it works every time.<\/p>\n<p>So here goes&#8230;<\/p>\n<p>You come across dates as a string of text and they look like this:<\/p>\n<ul>\n<li>1.1.2015<\/li>\n<li>1.2015<\/li>\n<li>01 01 2015<\/li>\n<li>2015\/1\/1<\/li>\n<\/ul>\n<p>In my example, the dates come out as dd\/mm\/yyyy format but it really is text.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5673\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.34.20 PM\" width=\"398\" height=\"334\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM.png 398w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM-150x126.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM-300x252.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM-250x210.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM-214x180.png 214w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.34.20-PM-357x300.png 357w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/p>\n<p>Select the text you want to convert and then go to &#8216;Data&gt;Text to Columns&#8217;<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5674\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.36.22 PM\" width=\"344\" height=\"397\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM.png 344w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM-130x150.png 130w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM-260x300.png 260w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM-250x289.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.22-PM-156x180.png 156w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/p>\n<p>A dialog box will open. Just keep the selection as &#8216;Delimited&#8217; and click &#8216;Next.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5675\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.36.58 PM\" width=\"531\" height=\"423\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM.png 531w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM-150x119.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM-300x239.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM-250x199.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM-226x180.png 226w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.36.58-PM-377x300.png 377w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/p>\n<p>On the next dialog box, select which ever delimiter is what separates the day, month and year for your text dates. In my example, &#8220;\/&#8221; separates my text so I selected &#8216;Other&#8217; and then inputted &#8216;\/&#8217;.\u00c2\u00a0 This puts each number into its own column. Click &#8216;Next&#8217;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5676\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.38.55 PM\" width=\"528\" height=\"419\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM.png 528w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM-150x119.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM-300x238.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM-250x198.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM-227x180.png 227w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.38.55-PM-378x300.png 378w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/p>\n<p>In the final dialog box, just keep everything the way it is and change the destination to where you want the new columns to be added. Click &#8216;Finish&#8217;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5677\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.41.31 PM\" width=\"528\" height=\"417\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM.png 528w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM-150x118.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM-300x237.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM-250x197.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM-228x180.png 228w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.41.31-PM-380x300.png 380w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/p>\n<p>This puts each number from the text dates into their own column.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5678\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM.png\" alt=\"Screen Shot 2017-03-25 at 2.44.03 PM\" width=\"302\" height=\"333\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM.png 302w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM-136x150.png 136w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM-272x300.png 272w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM-250x276.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-2.44.03-PM-163x180.png 163w\" sizes=\"(max-width: 302px) 100vw, 302px\" \/><\/p>\n<p>Now I need to combine the numbers into the format that I want (yyyy-mm-dd). This requires a simple equation to merge the values in each column based on the order of the values I want.<\/p>\n<p>=(D2&amp;&#8221;-&#8220;&amp;C2&amp;&#8221;-&#8220;&amp;B2)<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5681\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM.png\" alt=\"Screen Shot 2017-03-25 at 3.46.03 PM\" width=\"380\" height=\"335\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM.png 380w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM-150x132.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM-300x264.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM-250x220.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM-204x180.png 204w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-3.46.03-PM-340x300.png 340w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><\/p>\n<p>Once the numbers are merged, I need to copy the values (not the equations) into a new column in the &#8220;date&#8221; format. Under &#8216;Edit&#8217;, select &#8216;Paste Special&#8217; and then choose &#8216;Values&#8217;. Click &#8216;Ok&#8217;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5683\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM.png\" alt=\"Screen Shot 2017-03-25 at 4.03.24 PM\" width=\"551\" height=\"615\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM.png 551w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-134x150.png 134w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-269x300.png 269w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-250x279.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-550x614.png 550w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-161x180.png 161w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.03.24-PM-448x500.png 448w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/p>\n<p>While the converted value is a number, in order to turn it into dates that Excel can recognize, I need to run a simple equation using &#8216;=Value (cell number)&#8217;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5684\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM.png\" alt=\"Screen Shot 2017-03-25 at 4.04.35 PM\" width=\"567\" height=\"334\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM.png 567w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-150x88.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-300x177.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-250x147.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-550x324.png 550w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-306x180.png 306w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.04.35-PM-509x300.png 509w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/p>\n<p>I then redo the &#8216;Paste Special&#8217; process on the &#8216;Value Equation&#8217; column to move the values into a column that is formatted as &#8216;Date&#8217;.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-5685\" src=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM.png\" alt=\"Screen Shot 2017-03-25 at 4.07.01 PM\" width=\"656\" height=\"381\" srcset=\"https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM.png 656w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-150x87.png 150w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-300x174.png 300w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-250x145.png 250w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-550x319.png 550w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-310x180.png 310w, https:\/\/www.vincentfung.ca\/blog\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-25-at-4.07.01-PM-517x300.png 517w\" sizes=\"(max-width: 656px) 100vw, 656px\" \/><\/p>\n<p>There&#8217;s probably a quicker way to do this, but this is the best way I&#8217;ve found that provides the most control on addressing the number rather than fiddling with Excel&#8217;s functions to format columns&#8230; and it works every time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Despite having the world&#8217;s knowledge at my finger tips (i.e. the internet), I always forget little tips on how to do things in Excel. Yes, there&#8217;s bookmarks and other different ways to save websites, but I can never find them again after I saved them! So maybe writing a blog about it might be a &hellip; <a href=\"https:\/\/www.vincentfung.ca\/blog\/archives\/5665\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">I always forget how to convert simple text strings into dates in&nbsp;Excel<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":5691,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[124,137],"tags":[454,452,451,323,453,402],"_links":{"self":[{"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/posts\/5665"}],"collection":[{"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/comments?post=5665"}],"version-history":[{"count":9,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/posts\/5665\/revisions"}],"predecessor-version":[{"id":5692,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/posts\/5665\/revisions\/5692"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/media\/5691"}],"wp:attachment":[{"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/media?parent=5665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/categories?post=5665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentfung.ca\/blog\/wp-json\/wp\/v2\/tags?post=5665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}