{"id":2752,"date":"2026-08-06T10:37:54","date_gmt":"2026-08-06T09:37:54","guid":{"rendered":"https:\/\/wiskunst.nl\/?page_id=2752"},"modified":"2026-08-06T15:24:39","modified_gmt":"2026-08-06T14:24:39","slug":"wiskundige-functies","status":"publish","type":"page","link":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/","title":{"rendered":"Diverse functies"},"content":{"rendered":"<p><strong><span class=\"collapseomatic \" id=\"id6a750ec5990a6\"  tabindex=\"0\" title=\"Inhoud\"    >Inhoud<\/span><div id=\"target-id6a750ec5990a6\" class=\"collapseomatic_content \"><\/strong><\/p>\n<ul>\n<li><a href=\"#inleiding\">Inleiding<\/a><\/li>\n<li><a href=\"#abcformule\">ABC-Formule<\/a><\/li>\n<li><a href=\"#diagsom\">DiagSom<\/a><\/li>\n<li><a href=\"#feestdagen\">Feestdagen<\/a><\/li>\n<\/ul>\n<\/div>\n<h4><a id=\"inleiding\"><\/a>Inleiding<\/h4>\n<p>In dit artikel gaan we enkele UDF&#8217;s uit de add-in Handigheidjes maken.<br \/>\nHet is van belang dat u de training <a href=\"https:\/\/wiskunst.nl\/trainingen\/excel\/programmeren\/index.html\" target=\"_blank\" rel=\"noopener\">Excel Programmeren<\/a> heeft gevolgd.<br \/>\nWe gaan hier niet uitgebreid in op de VBA-code maar, indien noodzakelijk, meer op de wiskundige inhoud.<\/p>\n<h4><a id=\"abcformule\"><\/a>ABC-Formule<\/h4>\n<p>Weet u het nog? Om de oplossingen (ook wel wortels genoemd) van een tweedegraads vergelijking te krijgen kun je gebruik maken van de beroemde (en evenzo beruchte) ABC-formule.<\/p>\n<p>Deze luid:<\/p>\n<div class=\"wp-katex-eq katex-display\" data-display=\"true\">ax^{2}+bx+c=0 \\Rightarrow x_{1},x_{2}=\\frac{-b\\pm \\sqrt{b^{2}-4ac}}{2a}<\/div>\n<p>En dit kunnen we vrij eenvoudig in een UDF omzetten.<\/p>\n<p>We moeten wel rekening houden met de verschillende waarden die a, b en c kunnen hebben.<\/p>\n<p>We onderscheiden:<\/p>\n<ol>\n<li>a=0, b=0, c=0: Dan staat er 0=0 en is de oplossing \u211d of \u2102;<\/li>\n<li>a=0, b=0, c&lt;&gt;0: Dan staat er iets als 4=0 en dat betekent dat er geen oplossingen zijn;<\/li>\n<li>a=0, b&lt;&gt;0, c=0 of c&lt;&gt;0: Nu hebben we te maken met een eerstegraads vergelijking ax+b=0. De oplossing (eentje maar) is x=-c\/b;<\/li>\n<li>a&lt;&gt;0, b=0 of b&lt;&gt;0, c=0 of c&lt;&gt;0: Nu hebben we een echte tweedegraads vergelijking te pakken.<br \/>\nEn nu zijn er twee smaken die afhangen van de waarde van de discriminant (=b<sup>2<\/sup>-4ac).<br \/>\nDus eerst de discriminant bepalen:<\/p>\n<ol>\n<li>discriminant&gt;=0: Dan volgen de oplossingen uit de ABC-formule;<\/li>\n<li>discriminant&lt;0: Dan zijn de oplossingen complexe getallen. Dat zijn getallen p+qi waarbij p, q \u2208 \u211d en i<sup>2<\/sup>=-1.<br \/>\nNu krijgt p de waarde -b\/2a en q de waarde van \u00b1 \u221a(-discriminant)\/2a i.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Het resultaat van de UDF geven we terug als een array met x1, x2 en de discriminant.<\/p>\n<p>In code kan het er als volgt uitzien:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function ABC_Formule(ByVal a, ByVal b, ByVal c) As Variant<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d As Variant<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim x1 As Variant, x2 As Variant<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If a = 0 And b = 0 And c = 0 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(&#8220;R&#8221;, &#8220;R&#8221;, &#8220;n.v.t.&#8221;)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 ElseIf a = 0 And b = 0 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(&#8220;n.v.t.&#8221;, &#8220;n.v.t.&#8221;, &#8220;n.v.t.&#8221;)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 ElseIf a = 0 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 x1 = -c \/ b<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 x2 = x1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(x1, x2, &#8220;n.v.t.&#8221;)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 d = b * b &#8211; 4 * a * c<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If d &gt;= 0 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x1 = (-b &#8211; Sqr(d)) \/ (2 * a)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x2 = (-b + Sqr(d)) \/ (2 * a)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x1 = -b \/ (2 * a) &amp; &#8221; &#8221; &amp; -Sqr(-d) \/ (2 * a) &amp; &#8221; i&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x2 = -b \/ (2 * a) &amp; &#8221; + &#8221; &amp; Sqr(-d) \/ (2 * a) &amp; &#8221; i&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(x1, x2, d)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Uiteraard kan deze functie nog robuuster worden gemaakt met een On Error systeem.<\/p>\n<h4><a id=\"diagsom\"><\/a>DiagSom<\/h4>\n<p>Stel dat je een vierkante matrix hebt en je wilt van iedere kolom, rij en hoofddiagonalen de som weten.<br \/>\nVoor de rijen en kolommen kun je gewoon de functie SOM gebruiken, maar voor de hoofddiagonalen is er geen standaard functie.<\/p>\n<p>Die gaan we dus maar zelf maken.<\/p>\n<p>Kijk eens naar het voorbeeld:<\/p>\n<table style=\"border-collapse: collapse; width: 192pt; border-style: solid;\" border=\"0\" width=\"192pt\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr style=\"border-style: solid;\">\n<td class=\"xl63\" style=\"height: 14.4pt; width: 63.7344px; border-style: solid; text-align: center;\" height=\"19\"><\/td>\n<td class=\"xl63\" style=\"width: 63.7188px; border-style: solid; text-align: center;\"><\/td>\n<td class=\"xl63\" style=\"width: 63.7656px; border-style: solid; text-align: center;\"><\/td>\n<td class=\"xl65\" style=\"width: 63.7812px; border-style: solid; text-align: center;\"><span style=\"color: #ff0000;\"><strong>16<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border-style: solid;\">\n<td class=\"xl64\" style=\"height: 14.4pt; width: 63.7344px; border-style: solid; text-align: center;\" height=\"19\"><em>2<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7188px; border-style: solid; text-align: center;\"><em>4<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7656px; border-style: solid; text-align: center;\"><em>6<\/em><\/td>\n<td class=\"xl65\" style=\"width: 63.7812px; border-style: solid; text-align: center;\"><strong>12<\/strong><\/td>\n<\/tr>\n<tr style=\"border-style: solid;\">\n<td class=\"xl64\" style=\"height: 14.4pt; width: 63.7344px; border-style: solid; text-align: center;\" height=\"19\"><em>1<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7188px; border-style: solid; text-align: center;\"><em>3<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7656px; border-style: solid; text-align: center;\"><em>5<\/em><\/td>\n<td class=\"xl65\" style=\"width: 63.7812px; border-style: solid; text-align: center;\"><strong>9<\/strong><\/td>\n<\/tr>\n<tr style=\"border-style: solid;\">\n<td class=\"xl64\" style=\"height: 14.4pt; width: 63.7344px; border-style: solid; text-align: center;\" height=\"19\"><em>7<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7188px; border-style: solid; text-align: center;\"><em>8<\/em><\/td>\n<td class=\"xl64\" style=\"width: 63.7656px; border-style: solid; text-align: center;\"><em>9<\/em><\/td>\n<td class=\"xl65\" style=\"width: 63.7812px; border-style: solid; text-align: center;\"><strong>24<\/strong><\/td>\n<\/tr>\n<tr style=\"border-style: solid;\">\n<td class=\"xl65\" style=\"height: 14.4pt; width: 63.7344px; border-style: solid; text-align: center;\" height=\"19\"><strong>10<\/strong><\/td>\n<td class=\"xl65\" style=\"width: 63.7188px; border-style: solid; text-align: center;\"><strong>15<\/strong><\/td>\n<td class=\"xl65\" style=\"width: 63.7656px; border-style: solid; text-align: center;\"><strong>20<\/strong><\/td>\n<td class=\"xl65\" style=\"width: 63.7812px; border-style: solid; text-align: center;\"><span style=\"color: #ff0000;\"><strong>14<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>De vetgedrukte getallen krijg je met de SOM-functie. Voor de rode getallen bestaat (nog) geen functie.<\/p>\n<p>Een vierkante matrix heeft dus evenveel rijen als kolommen en heeft twee hoofddiagonalen, namelijk \u00e9\u00e9n van linksboven naar rechtsonder en \u00e9\u00e9n van linksonder naar rechtsboven. Daar moeten we dus rekening mee houden.<\/p>\n<p>We noemen de UDF DiagSom en deze krijgt twee parameters. De eerste is de reeks waarvan de DiagSom willen berekenen en de tweede is een Boolean die aangeeft van welke hoofddiagonaal we de som willen bepalen. Deze tweede parameter maken we optioneel met als default waarde de hoofddiagonaal van linksboven naar rechtsonder.<\/p>\n<p>In de functie moeten we eerst bepalen of de matrix (reek) vierkant is, want anders zijn er geen hoofddiagonalen.<br \/>\nVerder zullen we per cel bepalen of er een numerieke waarde instaat en zo ja dan wordt deze meegenomen in de te bepalen som.<\/p>\n<p>Een en ander kan er als volgt uitzien:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function DiagSom(ByVal Reeks As Range, Optional lbro As Boolean = True) As Variant<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim r As Integer, k As Integer<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim som As Variant<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 som = 0<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Reeks.Columns.Count = Reeks.Rows.Count Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For r = 1 To Reeks.Rows.Count<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 For k = 1 To Reeks.Columns.Count<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If lbro Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If r = k Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If IsNumeric(Reeks(r, k).value) Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 som = som + Reeks(r, k).value<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If r = Reeks.Columns.Count &#8211; k + 1 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If IsNumeric(Reeks(r, k).value) Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 som = som + Reeks(r, k).value<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Next k<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next r<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 DiagSom = som<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 DiagSom = &#8220;n.v.t.&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<h4><a id=\"feestdagen\"><\/a>Feestdagen<\/h4>\n<p>Hoe handig is het om de feestdagen in een bepaald jaar op een rijtje te hebben? Daar gaan we in deze paragraaf voor zorgen.<\/p>\n<p>Als voorbeeld de feestdagen in het jaar 2026:<\/p>\n<table width=\"236\">\n<tbody>\n<tr>\n<td style=\"border-style: solid;\" width=\"126\"><\/td>\n<td style=\"border-style: solid;\" width=\"36\">2026<\/td>\n<td style=\"border-style: solid;\" width=\"74\"><\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Nieuwjaar<\/td>\n<td style=\"border-style: solid;\">do<\/td>\n<td style=\"border-style: solid;\">1-1-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Drie Koningen<\/td>\n<td style=\"border-style: solid;\">di<\/td>\n<td style=\"border-style: solid;\">6-1-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Valentijnsdag<\/td>\n<td style=\"border-style: solid;\">za<\/td>\n<td style=\"border-style: solid;\">14-2-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Carnaval<\/td>\n<td style=\"border-style: solid;\">zo<\/td>\n<td style=\"border-style: solid;\">15-2-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Goede vrijdag<\/td>\n<td style=\"border-style: solid;\">vr<\/td>\n<td style=\"border-style: solid;\">3-4-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Pasen<\/td>\n<td style=\"border-style: solid;\">zo<\/td>\n<td style=\"border-style: solid;\">5-4-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Tweede paasdag<\/td>\n<td style=\"border-style: solid;\">ma<\/td>\n<td style=\"border-style: solid;\">6-4-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Koningsdag<\/td>\n<td style=\"border-style: solid;\">ma<\/td>\n<td style=\"border-style: solid;\">27-4-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Dodenherdenking<\/td>\n<td style=\"border-style: solid;\">ma<\/td>\n<td style=\"border-style: solid;\">4-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Bevrijdingsdag<\/td>\n<td style=\"border-style: solid;\">di<\/td>\n<td style=\"border-style: solid;\">5-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Moederdag<\/td>\n<td style=\"border-style: solid;\">zo<\/td>\n<td style=\"border-style: solid;\">10-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Hemelvaart<\/td>\n<td style=\"border-style: solid;\">do<\/td>\n<td style=\"border-style: solid;\">14-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Pinksteren<\/td>\n<td style=\"border-style: solid;\">zo<\/td>\n<td style=\"border-style: solid;\">24-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Tweede pinksterdag<\/td>\n<td style=\"border-style: solid;\">ma<\/td>\n<td style=\"border-style: solid;\">25-5-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Vaderdag<\/td>\n<td style=\"border-style: solid;\">zo<\/td>\n<td style=\"border-style: solid;\">21-6-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Prinsjesdag<\/td>\n<td style=\"border-style: solid;\">di<\/td>\n<td style=\"border-style: solid;\">15-9-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Sinterklaas<\/td>\n<td style=\"border-style: solid;\">za<\/td>\n<td style=\"border-style: solid;\">5-12-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Kerst<\/td>\n<td style=\"border-style: solid;\">vr<\/td>\n<td style=\"border-style: solid;\">25-12-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Tweede kerstdag<\/td>\n<td style=\"border-style: solid;\">za<\/td>\n<td style=\"border-style: solid;\">26-12-2026<\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: solid;\">Oudejaarsdag<\/td>\n<td style=\"border-style: solid;\">do<\/td>\n<td style=\"border-style: solid;\">31-12-2026<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Veel Christelijke feestdagen hangen af van wanneer Pasen valt. Volgens de Christelijke kerk val Pasen op de eerste zondag na de eerste volle maan in de lente. De lente valt, volgens de kerk, op 21 maart.<\/p>\n<p>De feestdagen Carnaval, Goede vrijdag, tweede paasdag, Hemelvaart en eerste en tweede Pinksterdag zijn allemaal afhankelijk van eerst paasdag.<br \/>\nDe andere feestdagen hebben een vaste datum in het jaar.<\/p>\n<p>We moeten dus beginnen met een UDF die de eerste Paasdag berekent. Deze functie heeft als parameter het jaar waarvan we de eerste Paasdag willen bepalen.<br \/>\nDeze functie maakt gebruik van het algoritme van Meeus, Jones en Butcher. De uitleg staat als commentaar tussen de regels:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Pasen(ByVal jaar As Long) As Date<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">&#8216;gebruikt het algoritme van Meeus\/Jones\/Butcher<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim a, b, c, d, e, g, h, i, j, k, l, m, n, o<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;maanstanden herhalen zich elke 19 jaar; a bepaalt waar in deze cyclus<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 a = jaar Mod 19<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;b bepaalt eeuwgetal (19 of 20 etc.)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 b = jaar \\ 100<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;c bepaalt jaar binnen de eeuw (78 of 26 etc.)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 c = jaar Mod 100<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;d, e, g berekenen correcties voor schrikkeljaren en kleine afwijkingen in maandcycli<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = b \\ 4<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 e = b Mod 4<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 g = (8 * b + 13) \\ 25<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;h, i, j bepalen de epacta, dit is de ouderdom van de maan op 1 januari van het jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 h = (11 * (b &#8211; d &#8211; g) &#8211; 4) \\ 30<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 i = (7 * a + h + 6) \\ 11<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;j geeft aantal dagen dat kerkelijke volle maan valt na 21 maart<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 j = (19 * a + (b &#8211; d &#8211; g) + 15 &#8211; i) Mod 29<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;k, l, m bepalen wanneer het de zondag na de volle maan is (daar Pasen op een zondag moet vallen)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 k = c \\ 4<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 l = c Mod 4<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 m = ((32 + 2 * e) + 2 * k &#8211; l &#8211; j) Mod 7<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8217;n bepaalt de maand (maart (3) of april (4))<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 n = (90 + (j + m)) \\ 25<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8216;o bepaalt de dag in de maand<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 o = (19 + (j + m) + n) Mod 32<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Pasen = CDate(o &amp; &#8220;-&#8221; &amp; n &amp; &#8220;-&#8221; &amp; jaar) <\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Pinksteren valt 49 dagen na Pasen. De UDF Pinksteren bepaalt eerst de datum van Pasen en telt daar door middel van de functie DateAdd er 49 dagen bij op:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Pinksteren(ByVal jaar As Long) As Date<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d, p<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = HJG_Pasen(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = CDate(p)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = DateAdd(&#8220;d&#8221;, 49, p)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Pinksteren = d <\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Hemelvaart valt 10 dagen voor Pinksteren:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Hemelvaart(ByVal jaar As Long) As Date<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d, p<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = Pinksteren(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = CDate(p)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = DateAdd(&#8220;d&#8221;, -10, p)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Hemelvaart = d <\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Voor moederdag, vaderdag en Prinsjesdag geldt dat ze allemaal op een bepaalde weekdag in een bepaalde maand vallen.<\/p>\n<p>Moederdag valt op de tweede zondag van Mei. In de UDF moeten we dus beginnen op 1 Mei en dan het aantal zondagen tellen. Met de functie Weekday bepalen we de dag in de week van een bepaalde datum:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Moederdag(ByVal jaar As Long) As Date<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(&#8220;1-5-&#8221; &amp; jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 2<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 1 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(&#8220;d&#8221;, 1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Moederdag = DateAdd(&#8220;d&#8221;, -1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Vaderdag is op de derde zondag van juni:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Vaderdag(ByVal jaar As Long) As Date<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(&#8220;1-6-&#8221; &amp; jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 3<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 1 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(&#8220;d&#8221;, 1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Vaderdag = DateAdd(&#8220;d&#8221;, -1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>En Prinsjesdag valt op de derde dinsdag van September:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Prinsjesdag(ByVal jaar As Long) As Date<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(&#8220;1-9-&#8221; &amp; jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 3<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 3 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(&#8220;d&#8221;, 1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Prinsjesdag = DateAdd(&#8220;d&#8221;, -1, sd)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Voor de UDF Feestdagen, die we zo gaan presenteren, maken we twee versies. Een uitgebreide versie en \u00e9\u00e9n met alleen de offici\u00eble Nederlandse feestdagen.<\/p>\n<p>Om het eenvoudig te maken later de UDF uit te breiden met andere feestdagen is de volgorde waarin de feestdagen worden bepaalt in de UDF zelf niet van belang. Voordat de UDF de resultaten weergeeft, in een Array, wordt alles eerst gesorteerd op datum.<br \/>\nDe feestdagen komen in de UDF in een tweedimensionale Array te staan die met een aparte Sorteer functie wordt gesorteerd. Omdat deze sorteerfunctie alleen binnen de module wordt gebruikt is deze als Private gedeclareerd. De parameter is in dit geval ByRef omdat deze zelfde array gesorteerd moet worden teruggegeven:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Private Sub Feest_Sorteer(ByRef opl() As String)<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d1, d2<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim i, j<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim tmp(1 To 1, 1 To 3) As String<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d1 = UBound(opl, 1)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d2 = UBound(opl, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 For j = 1 To d1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For i = 1 To d1 &#8211; 1<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If CDate(opl(i, 3)) &gt; CDate(opl(i + 1, 3)) Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tmp(1, 1) = opl(i, 1)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tmp(1, 2) = opl(i, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tmp(1, 3) = opl(i, 3)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i, 1) = opl(i + 1, 1)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i, 2) = opl(i + 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i, 3) = opl(i + 1, 3)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i + 1, 1) = tmp(1, 1)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i + 1, 2) = tmp(1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opl(i + 1, 3) = tmp(1, 3)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next i<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Next j<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Sub<\/span><\/p>\n<p>En dan nu de UDF waar het allemaal om draait. Vooraf nog even een opmerking over Koningsdag. Tot en met 2013 was dit Koninginnedag en werd gevierd op 30 April. Vanaf 2014 wordt Koningsdag op 27 April gevierd. Voor beide dagen geldt dat wanneer deze datum op een zondag valt de feestdag naar de zaterdag ervoor wordt verplaatst. De UDF houdt daar allemaal rekening mee:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function FeestDagen(ByVal jaar As Long, Optional Uitgebreid As Boolean = False)<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim dagen As String, dag As String<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim vpasen, vpinksteren, vhemelvaart<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim vnieuwjaar, vkoning, vkerst, vbevrijding<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim opl(1 To 7, 1 To 3) As String<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim oplext(1 To 20, 1 To 3) As String<\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dagen = &#8220;zomadiwodovrza&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;1-1-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vnieuwjaar = &#8220;1-1-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 1) = &#8220;Nieuwjaar&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 3) = vnieuwjaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vpasen = HJG_Pasen(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vpasen)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 1) = &#8220;Pasen&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 3) = vpasen<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vhemelvaart = HJG_Hemelvaart(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vhemelvaart)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 1) = &#8220;Hemelvaart&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 3) = vhemelvaart<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vpinksteren = HJG_Pinksteren(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vpinksteren)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 1) = &#8220;Pinksteren&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 3) = vpinksteren<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;25-12-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vkerst = &#8220;25-12-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 1) = &#8220;Kerst&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 3) = vkerst<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If jaar &lt; 2014 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;30-4-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = &#8220;30-4-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If dag = &#8220;zo&#8221; Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;29-4-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = &#8220;29-4-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;27-4-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = &#8220;27-4-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If dag = &#8220;zo&#8221; Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;26-4-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 vkoning = &#8220;26-4-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If jaar &lt; 2014 Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 opl(6, 1) = &#8220;Koninginnedag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 opl(6, 1) = &#8220;Koningsdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(6, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(6, 3) = vkoning<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(&#8220;5-5-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vbevrijding = &#8220;5-5-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 1) = &#8220;Bevrijdingsdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 2) = dag<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 3) = vbevrijding<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Dim i As Integer, j As Integer<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For i = 1 To 7<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 For j = 1 To 3<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 oplext(i, j) = opl(i, j)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Next j<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next i<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 1) = &#8220;Goede vrijdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 2) = &#8220;vr&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 3) = DateAdd(&#8220;d&#8221;, -2, vpasen)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 1) = &#8220;Tweede paasdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 2) = &#8220;ma&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 3) = DateAdd(&#8220;d&#8221;, 1, vpasen)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 1) = &#8220;Tweede pinksterdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 2) = &#8220;ma&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 3) = DateAdd(&#8220;d&#8221;, 1, vpinksteren)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 1) = &#8220;Tweede kerstdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;26-12-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 3) = &#8220;26-12-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 1) = &#8220;Oudejaarsdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;31-12-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 3) = &#8220;31-12-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 1) = &#8220;Drie Koningen&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;6-1-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 3) = &#8220;6-1-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 1) = &#8220;Carnaval&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 2) = Mid(dagen, 2 * Weekday(DateAdd(&#8220;ww&#8221;, -7, vpasen)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 3) = DateAdd(&#8220;ww&#8221;, -7, vpasen)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 1) = &#8220;Dodenherdenking&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;4-5-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 3) = &#8220;4-5-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 1) = &#8220;Valentijnsdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;14-2-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 3) = &#8220;14-2-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 1) = &#8220;Sinterklaas&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 2) = Mid(dagen, 2 * Weekday(CDate(&#8220;5-12-&#8221; &amp; jaar)) &#8211; 1, 2)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 3) = &#8220;5-12-&#8221; &amp; jaar<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 1) = &#8220;Moederdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 2) = &#8220;zo&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 3) = Moederdag(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 1) = &#8220;Vaderdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 2) = &#8220;zo&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 3) = Vaderdag(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 1) = &#8220;Prinsjesdag&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 2) = &#8220;di&#8221;<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 3) = Prinsjesdag(jaar)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Feest_Sorteer oplext<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Feest_Sorteer opl<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 FeestDagen = oplext<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 FeestDagen = opl<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/p>\n<p>Als u een feestdag wilt toevoegen dan kan dat gewoon onderaan de code. U moet dan wel de eerste dimensie van de Array oplext met 1 verhogen en dat hoogste nummer gebruiken voor de Array (dus oplext(21, 1) = &#8220;mijn feestdag&#8221;), etc.<\/p>\n<p>Zo kunt u bijvoorbeeld de Islamitische dagen Ramadam (de 1e dag), Suikerfeest (Eid al-Fitr) en Offerfeest (Eid al-Adha) toevoegen. Dit kan met de volgende formules:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">ramdate=Int((Jaar &#8211; 1900) * 354.367 + 1421.44)<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">If Jaar &lt; 1997 Then <\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sprong = -366<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">If Jaar &gt; 2030 Then <\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sprong = 365<\/span><br \/>\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Ramadan = ramdate + sprong<\/span><\/p>\n<p>Het Suikerfeest is 30 dagen later en het Offerfeest 98 dagen later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inleiding In dit artikel gaan we enkele UDF&#8217;s uit de add-in Handigheidjes maken. Het is van belang dat u de training Excel Programmeren heeft gevolgd. We gaan hier niet uitgebreid in op de VBA-code maar, indien noodzakelijk, meer op de wiskundige inhoud. ABC-Formule Weet u het nog? Om de oplossingen (ook wel wortels genoemd) van [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2747,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/template-full-width.php","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"class_list":["post-2752","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Diverse functies - Wiskunst<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Diverse functies - Wiskunst\" \/>\n<meta property=\"og:description\" content=\"Inleiding In dit artikel gaan we enkele UDF&#8217;s uit de add-in Handigheidjes maken. Het is van belang dat u de training Excel Programmeren heeft gevolgd. We gaan hier niet uitgebreid in op de VBA-code maar, indien noodzakelijk, meer op de wiskundige inhoud. ABC-Formule Weet u het nog? Om de oplossingen (ook wel wortels genoemd) van [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/\" \/>\n<meta property=\"og:site_name\" content=\"Wiskunst\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-06T14:24:39+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data1\" content=\"13 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/\",\"url\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/\",\"name\":\"Diverse functies - Wiskunst\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/#website\"},\"datePublished\":\"2026-08-06T09:37:54+00:00\",\"dateModified\":\"2026-08-06T14:24:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wiskunst.nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programmeren\",\"item\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Programmeren in Excel\",\"item\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Diverse functies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/#website\",\"url\":\"https:\\\/\\\/wiskunst.nl\\\/\",\"name\":\"Wiskunst\",\"description\":\"2\u221e\u2227&gt;\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wiskunst.nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Diverse functies - Wiskunst","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:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/","og_locale":"nl_NL","og_type":"article","og_title":"Diverse functies - Wiskunst","og_description":"Inleiding In dit artikel gaan we enkele UDF&#8217;s uit de add-in Handigheidjes maken. Het is van belang dat u de training Excel Programmeren heeft gevolgd. We gaan hier niet uitgebreid in op de VBA-code maar, indien noodzakelijk, meer op de wiskundige inhoud. ABC-Formule Weet u het nog? Om de oplossingen (ook wel wortels genoemd) van [&hellip;]","og_url":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/","og_site_name":"Wiskunst","article_modified_time":"2026-08-06T14:24:39+00:00","twitter_card":"summary_large_image","twitter_misc":{"Geschatte leestijd":"13 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/","url":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/","name":"Diverse functies - Wiskunst","isPartOf":{"@id":"https:\/\/wiskunst.nl\/#website"},"datePublished":"2026-08-06T09:37:54+00:00","dateModified":"2026-08-06T14:24:39+00:00","breadcrumb":{"@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wiskunst.nl\/"},{"@type":"ListItem","position":2,"name":"Programmeren","item":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/"},{"@type":"ListItem","position":3,"name":"Programmeren in Excel","item":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/"},{"@type":"ListItem","position":4,"name":"Diverse functies"}]},{"@type":"WebSite","@id":"https:\/\/wiskunst.nl\/#website","url":"https:\/\/wiskunst.nl\/","name":"Wiskunst","description":"2\u221e\u2227&gt;","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wiskunst.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"}]}},"_links":{"self":[{"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/comments?post=2752"}],"version-history":[{"count":26,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2752\/revisions"}],"predecessor-version":[{"id":2783,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2752\/revisions\/2783"}],"up":[{"embeddable":true,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2747"}],"wp:attachment":[{"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/media?parent=2752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}