{"id":6525,"date":"2014-01-16T14:49:31","date_gmt":"2014-01-16T06:49:31","guid":{"rendered":"http:\/\/www.boostsolutions.com\/blog\/?p=6525"},"modified":"2023-07-31T11:38:19","modified_gmt":"2023-07-31T03:38:19","slug":"tips-calculated-columns-sharepoint","status":"publish","type":"post","link":"https:\/\/www.boostsolutions.com\/blog\/tips-calculated-columns-sharepoint\/","title":{"rendered":"Tips about Calculated Columns in SharePoint"},"content":{"rendered":"<p>SharePoint Foundation&#8217;s formulas for calculated fields are based on Microsoft Excel&#8217;s functions and syntax.<\/p>\n<p>How do you apply it to SharePoint and use it for your business needs?<\/p>\n<p><b>The Scenario:<\/b><\/p>\n<p>Employee can use SharePoint to check their Paid Annual Leave (number of days taken, number of days left and so on) and then they can arrange their vacation.<\/p>\n<p><b>Logic of Paid Annual Leave:<\/b><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6529\" alt=\"Logic of Paid Annual\" src=\"http:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/Logic-of-Paid-Annual.png\" width=\"850\" height=\"542\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/Logic-of-Paid-Annual.png 850w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/Logic-of-Paid-Annual-300x191.png 300w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>SharePoint Solution:<\/b><\/p>\n<p><b>Paid Annual Leave List<\/b>:<\/p>\n<p>Employee Name, Employee ID, Department, Type, Work Start Date, Date on Board, Start Date, Annual Entitlement, Actual Annual Entitlement, Annual Leave Taken, Annual Leave Remaining, Notes.<\/p>\n<p>The &#8220;Today&#8221; Column is the same as the constant [Today] in SharePoint which is automatically written by Boostsolutions&#8217; Workflow Boost. (For more details see: <a href=\"http:\/\/www.boostsolutions.com\/workflow-boost.html\">http:\/\/www.boostsolutions.com\/workflow-boost.html<\/a>)<\/p>\n<p>Annual Entitlement: means the number of days off an employee is entitled to; this is based on the number of years they have worked and the Paid Annual Leave for the current year.<\/p>\n<p>Actual Annual Entitlement: means the number of days off an employee is entitled to; this is based on the number of days worked in the company and the number of days off an employee is entitled to.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Calculated Column:<\/b><\/p>\n<p>Annual Entitlement, Actual Annual Entitlement, Start Date, Days left<\/p>\n<p>&nbsp;<\/p>\n<p><b>Formula:<\/b><\/p>\n<p>Annual Entitlement=IF(Type =&#8221;Company&#8221;, IF(Today-Date on Board&gt;365,4+ROUNDDOWN(DATEDIF(Date on Board, Today,&#8221;d&#8221;)\/365,0),0),IF(Today- Work Start Date&gt;7300,15,IF(Today-Work Start Date&gt;3650,10,5)))<\/p>\n<p>&nbsp;<\/p>\n<p>Actual Annual Entitlement =IF(Type=&#8221;Company&#8221;, IF(DATEDIF(Date on Board, Today,&#8221;d&#8221;)&lt;365,0,ROUNDDOWN(DATEDIF(Date on Board,Today,&#8221;d&#8221;)\/365,0)+4),IF(DATEDIF(Date on Board,Today,&#8221;d&#8221;)&gt;365,Annual Entitlement ,ROUNDDOWN((DATEDIF(Date on Board, Start Date ,&#8221;d&#8221;)\/365*Annual Entitlement),0)))<\/p>\n<p>&nbsp;<\/p>\n<p>Start Date =IF(Type =&#8221;Company&#8221;, DATE(YEAR(Today),MONTH(Date on Board),Day(Date on Board)),DATE(YEAR(Today),12,31))<\/p>\n<p>&nbsp;<\/p>\n<p>Annual Leave Remaining = ROUND (Actual Annual Entitlement, 0)-ROUND (Annual Leave Taken,1)<\/p>\n<p>&nbsp;<\/p>\n<p><b>Function description:<\/b><\/p>\n<p>Function ROUNDOWN: To round down the number of dates between Date on Board and Today.<\/p>\n<p>Function DATEIF returns the number of days between the Date on Board and the Start Date of Paid Annual Leave.<\/p>\n<p>&nbsp;<\/p>\n<p>For more details please refer to<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb862071.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/bb862071.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SharePoint Foundation&#8217;s formulas for calculated fields are based on Microsoft Excel&#8217;s functions and syntax. How do you apply it to SharePoint and use it for your business needs? The Scenario: Employee can use SharePoint to check their Paid Annual Leave (number of days taken, number of days left and so on) and then they can [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[347],"tags":[],"_links":{"self":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6525"}],"collection":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6525"}],"version-history":[{"count":6,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6525\/revisions"}],"predecessor-version":[{"id":9154,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6525\/revisions\/9154"}],"wp:attachment":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}