{"id":13822,"date":"2026-03-14T13:29:29","date_gmt":"2026-03-14T17:29:29","guid":{"rendered":"https:\/\/www.both.org\/?p=13822"},"modified":"2026-03-14T14:45:59","modified_gmt":"2026-03-14T18:45:59","slug":"is-there-a-better-pi-day-than-march-14","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=13822","title":{"rendered":"Is there a better Pi Day than March 14?"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"13822\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>It&#8217;s <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pi_Day\">Pi Day<\/a> today! Today is an excellent opportunity to do &#8220;pi&#8221; related things, like <a href=\"https:\/\/www.both.org\/?p=12229\">measuring pi with a Raspberry Pi<\/a>.<\/p>\n\n\n\n<p>We celebrate this day because &#8220;March 14&#8221; is written as &#8220;3\/14&#8221; in the US, and the value of pi is 3.14 (to the first two decimal places). But in other countries, the date is instead written &#8220;14 March&#8221; or &#8220;14\/3&#8221; which is not recognizable as &#8220;pi.&#8221; That&#8217;s why some prefer to recognize Pi Day on other dates, like 22 July or &#8220;22\/7&#8221; which is a reasonable approximation of pi: 22 divided by 7 is about 3.1428.<\/p>\n\n\n\n<p>But there are 365 ways to divide &#8220;month by day,&#8221; and twice that if you also consider dividing &#8220;day by month.&#8221; Is there another date that gets closer to 3.14?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"calculating-dates\">Calculating dates<\/h2>\n\n\n\n<p>One way to divide &#8220;month by day&#8221; and &#8220;day by month&#8221; for <em>every day of the year<\/em> is to use a spreadsheet like <a href=\"https:\/\/www.libreoffice.org\/\">LibreOffice Calc<\/a>. Follow these steps to do it on your own:<\/p>\n\n\n\n<p>First, enter the date for January 1, 2025, in a cell. I&#8217;ve reserved the first row for labels, and entered my values and calculations starting in row 3. Enter the value &#8220;1\/1\/25&#8221; in cell A3. LibreOffice interprets this as a date, stores it internally as such, and displays the value using standard date formatting:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"383\" height=\"282\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/col_a.png\" alt=\"entering a date in LibreOffice Calc\" class=\"wp-image-13815\"\/><\/figure>\n\n\n\n<p>Next, use the <code>MONTH<\/code> and <code>DAY<\/code> functions to separate the month and day from the date. To do this, enter the function <code>=MONTH(A3)<\/code> in cell B3, and the function <code>=DAY(A3)<\/code> in cell C3:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"440\" height=\"281\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/col_c.png\" alt=\"entering a calculation in LibreOffice Calc\" class=\"wp-image-13816\"\/><\/figure>\n\n\n\n<p>Then, perform two separate calculations: Let&#8217;s use column D to divide &#8220;month by day,&#8221; and column E to divide &#8220;day by month.&#8221; Enter <code>=B3\/C3<\/code> in cell D3 (<em>month<\/em> divided by <em>day<\/em>) and <code>=C3\/B3<\/code> (<em>day<\/em> divided by <em>month<\/em>) in cell E3. These are both <strong>1<\/strong> for January 1, because it&#8217;s 1 divided by 1 either way. For now, we only need to the calculation for one day; we can use the spreadsheet to <em>auto-fill<\/em> the calculations for the other days of the year in another step:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"281\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/col_e.png\" alt=\"entering a calculation in LibreOffice Calc\" class=\"wp-image-13817\"\/><\/figure>\n\n\n\n<p>We also need to know how close this calculation is to the value of pi, which is about 3.14. The calculation might be greater than or less than pi, such as January 31: 1\/31 or <strong>0.0322<\/strong> is <em>less than<\/em> pi, and 31\/1 or <strong>31<\/strong> is <em>greater than<\/em> than pi. I find it easier to read positive values, so make one more pair of calculations in columns F and G to find the <em>absolute value<\/em> (always positive) difference from pi. To make this calculation, enter <code>=ABS(3.14-D3)<\/code> in cell F3, and <code>=ABS(3.14-E3)<\/code> in cell G3:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"281\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/col_g.png\" alt=\"entering a calculation in LibreOffice Calc\" class=\"wp-image-13818\"\/><\/figure>\n\n\n\n<p>Now that you&#8217;ve entered all of the calculations for January 1, we can let the spreadsheet do the hard work of calculating the other 364 days of the year. Use your mouse to click and drag from cell A3 to G3, which selects all of these cells at once. Note the &#8220;dot&#8221; in the lower-right corner of G3; draft this &#8220;dot&#8221; down to fill other rows in the spreadsheet, until you reach cell G367. The spreadsheet will automatically propagate or <em>auto-fill<\/em> the calculations in the highlighted row to the other rows in the spreadsheet:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"326\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/autofill.png\" alt=\"Performing an auto-fill in LibreOffice Calc\" class=\"wp-image-13814\"\/><\/figure>\n\n\n\n<p>That&#8217;s a lot of calculations, and a lot of results to evaluate. Dividing &#8220;month by day&#8221; and &#8220;day by month&#8221; gives us two columns of 365 different calculations, or 730 calculations total. How can we quickly determine which cell is closest to the value of pi?<\/p>\n\n\n\n<p>This is where we can use a feature called <em>conditional formatting<\/em> to highlight cells that match a condition. To find the calculations that are closest to the value of pi, we actually want to highlight the &#8220;difference&#8221; cells in columns F and G, which contain the <em>absolute value<\/em> of dividing &#8220;month by day&#8221; and &#8220;day by month&#8221; compared to the value <strong>3.14<\/strong>. Highlight the cells from F3 to G367, and use the <strong>Format &gt; Conditional<\/strong> menu action to create a <em>condition<\/em> where the value in those cells is <em>less than<\/em> some small value:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"176\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/condition.png\" alt=\"Using the menu to create a condition that is less than a value\" class=\"wp-image-13819\"\/><\/figure>\n\n\n\n<p>We can use any &#8220;difference&#8221; value here, but as a guess I entered &#8220;less than <strong>0.1<\/strong>&#8221; for the condition, and applied the cell style named &#8220;Good&#8221; to any matching cells:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"641\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/condition_1.png\" alt=\"Using the dialog action to create a condition that is less than the value 0.1\" class=\"wp-image-13820\"\/><\/figure>\n\n\n\n<p>The cell styles in the list are pre-defined in LibreOffice Calc; the &#8220;Good&#8221; style applies a light green background to the selected cells. This made it a pretty easy process to scan through the 365 rows to find the green cells. In a few seconds, I found that 22 July, or &#8220;22\/7,&#8221; was <em>in fact the closest value to pi<\/em> when you divide either &#8220;month by day&#8221; or &#8220;day by month&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"106\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2026\/03\/result.png\" alt=\"a highlighted row in LibreOffice, showing 22 July\" class=\"wp-image-13821\"\/><\/figure>\n\n\n\n<p>A few other dates that were also within the 0.1 difference were 31 October (31\/10, or <strong>3.1<\/strong>) and 25 August (25\/3, or <strong>3.125<\/strong>). But 22 July was the closest to pi, with a difference of just 0.002857143.<\/p>\n\n\n\n<p>So if you prefer to write your dates as &#8220;day month,&#8221; then 22 July is a better calculation of pi. But I prefer the visual way to represent pi as &#8220;3\/14&#8221; which looks like the value <strong>3.14<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is there another date that gets closer to 3.14?<\/p>\n","protected":false},"author":33,"featured_media":3196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[69,237],"tags":[147,133],"class_list":["post-13822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fun","category-libreoffice","tag-fun","tag-libreoffice"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13822"}],"version-history":[{"count":7,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13822\/revisions"}],"predecessor-version":[{"id":13829,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/13822\/revisions\/13829"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/3196"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}