{"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-25T09:36:49","modified_gmt":"2026-08-25T08:36:49","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=\"id6a8f89b253736\"  tabindex=\"0\" title=\"Inhoud\"    >Inhoud<\/span><div id=\"target-id6a8f89b253736\" 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=\"#sigma\">Sigma functies<\/a><\/li>\n<li><a href=\"#feestdagen\">Feestdagen<\/a><\/li>\n<li><a href=\"#astronomie\">Astronomie<\/a><\/li>\n<\/ul>\n<\/div>\n<h3><a id=\"inleiding\"><\/a>Inleiding<\/h3>\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<pre><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><\/pre>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b25379e\"  tabindex=\"0\" title=\"ABC_formule\"    >ABC_formule<\/span><div id=\"target-id6a8f89b25379e\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function ABC_Formule(ByVal a, ByVal b, ByVal c) As Variant<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d As Variant<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim x1 As Variant, x2 As Variant<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If a = 0 And b = 0 And c = 0 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(\"R\", \"R\", \"n.v.t.\")<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 ElseIf a = 0 And b = 0 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(\"n.v.t.\", \"n.v.t.\", \"n.v.t.\")<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 ElseIf a = 0 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 x1 = -c \/ b<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 x2 = x1<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(x1, x2, \"n.v.t.\")<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 d = b * b - 4 * a * c<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If d &gt;= 0 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x1 = (-b - Sqr(d)) \/ (2 * a)<\/span>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x1 = -b \/ (2 * a) &amp; \" \" &amp; -Sqr(-d) \/ (2 * a) &amp; \" i\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 x2 = -b \/ (2 * a) &amp; \" + \" &amp; Sqr(-d) \/ (2 * a) &amp; \" i\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 ABC_Formule = Array(x1, x2, d)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\n<p>Uiteraard kan deze functie nog robuuster worden gemaakt met een On Error systeem.<\/p>\n<h3><a id=\"diagsom\"><\/a>DiagSom<\/h3>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b2537ba\"  tabindex=\"0\" title=\"DiagSom\"    >DiagSom<\/span><div id=\"target-id6a8f89b2537ba\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><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>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim r As Integer, k As Integer<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim som As Variant<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 som = 0<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Reeks.Columns.Count = Reeks.Rows.Count Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For r = 1 To Reeks.Rows.Count<\/span>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 If lbro Then<\/span>\r\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>\r\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>\r\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>\r\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>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Else<\/span>\r\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 - k + 1 Then<\/span>\r\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>\r\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>\r\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>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Next k<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next r<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 DiagSom = som<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 DiagSom = \"n.v.t.\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\n<h3><a id=\"sigma\"><\/a>Sigma functies<\/h3>\n<p>Onder Sigma functies wordt verstaan het optellen van opeenvolgende gehele, even of oneven getallen vanaf 1 of 2.<\/p>\n<p>Daarvoor hebben we in de wiskunde een aantal formules tot onze beschikking zodat we in de code geen gebruik hoeven te maken van loops.<\/p>\n<p>De formule voor het optellen van de gehele getallen 1 t\/m n luidt:<\/p>\n<div class=\"wp-katex-eq katex-display\" data-display=\"true\">\\sum_{k=1}^{n}k=\\frac{1}{2}n(n+1)<\/div>\n<p>De UDF die daarbij hoort:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b2537d0\"  tabindex=\"0\" title=\"Sigma\"    >Sigma<\/span><div id=\"target-id6a8f89b2537d0\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Sigma(ByVal GeheelGetal As Long) As Long\r\n'bepaalt de som van 1 t\/m n \r\n\u00a0 \u00a0 Sigma = 0.5 * GeheelGetal * (GeheelGetal + 1) \r\nEnd Function<\/span><\/code><\/pre>\n<\/div>\n<p>Excel VBA kent geen functie om te bepalen of een geheel getal even of oneven is. Dit moeten we dus zelf doen:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b2537df\"  tabindex=\"0\" title=\"IsEven\"    >IsEven<\/span><div id=\"target-id6a8f89b2537df\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Private Function IsEven(ByVal GeheelGetal As Long) As Boolean\r\n'test of n even is\r\n\u00a0 \u00a0 IsEven = (GeheelGetal Mod 2 = 0)\r\nEnd Function<\/span><\/code><\/pre>\n<\/div>\n<p>De formule voor het optellen van de oneven gehele getallen van 2 t\/m n luidt:<\/p>\n<div class=\"wp-katex-eq katex-display\" data-display=\"true\">\\sum_{k=0}^{n}(2k-1)=\\left ( \\frac{n+1}{2} \\right )^{2}<\/div>\n<p>De bijbehorende UDF luidt:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b2537ef\"  tabindex=\"0\" title=\"SigmaOneven\"    >SigmaOneven<\/span><div id=\"target-id6a8f89b2537ef\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function SigmaOneven(ByVal GeheelGetal As Long) As Variant\r\n'bepaalt de som van de oneven getallen van 1 t\/m n\r\n\u00a0 \u00a0 If IsEven(GeheelGetal) Then\r\n\u00a0 \u00a0 \u00a0 \u00a0 SigmaOneven = \"n.v.t.\"\r\n\u00a0 \u00a0 Else\r\n\u00a0 \u00a0 \u00a0 \u00a0 SigmaOneven = ((GeheelGetal + 1) \/ 2) ^ 2\r\n\u00a0 \u00a0 End If\r\nEnd Function<\/span><\/code><\/pre>\n<\/div>\n<p>De formule voor het optellen van de even gehele getallen van 2 t\/m n luidt:<\/p>\n<div class=\"wp-katex-eq katex-display\" data-display=\"true\">\\sum_{k=0}^{n}2k=\\frac{n}{2}\\cdot (\\frac{n}{2}+1)<\/div>\n<p>De UDF ziet er dan als volgt uit:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b2537ff\"  tabindex=\"0\" title=\"SigmaEven\"    >SigmaEven<\/span><div id=\"target-id6a8f89b2537ff\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function SigmaEven(ByVal GeheelGetal As Long) As Variant\r\n'bepaalt de som van de even getallen van 1 t\/m n\r\n\u00a0 \u00a0 If IsEven(GeheelGetal) Then\r\n\u00a0 \u00a0 \u00a0 \u00a0 SigmaEven = (GeheelGetal \\ 2) * (GeheelGetal \\ 2 + 1)\r\n\u00a0 \u00a0 Else\r\n\u00a0 \u00a0 \u00a0 \u00a0 SigmaEven = \"n.v.t.\"\r\n\u00a0 \u00a0 End If\r\nEnd Function<\/span><\/code><\/pre>\n<\/div>\n<p>En dan zijn er nog drie varianten op dit thema.<br \/>\nSigmaVanTot die niet vanaf 1 begint maar van een ander (geheel) getal begint,<br \/>\nSigmaOnevenVanTot die niet vanaf 1 begint maar van een ander oneven (geheel) getal en<br \/>\nSigmaEvenTot die niet vanaf 2 begint maar van een andere even (geheel) getal.<br \/>\nDe truc is hierbij vrij simpel: Bepaal de Sigma (dus vanaf 1) en trek daar het deel af van Sigma(startgetal &#8211; 1) of (startgetal &#8211; 2) als het SigemaEven of SigmaOneven betreft:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b25380c\"  tabindex=\"0\" title=\"Sigma&#039;s van tot\"    >Sigma's van tot<\/span><div id=\"target-id6a8f89b25380c\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function SigmaVanTot(ByVal van As Long, ByVal tot As Long) As Variant\r\n'bepaalt de som van \"van\" t\/m \"tot\"\r\n\u00a0 \u00a0 SigmaVanTot = Sigma(tot) - Sigma(van - 1)\r\nEnd Function\r\n\r\nFunction SigmaOnevenVanTot(ByVal van As Long, ByVal tot As Long) As Variant\r\n'bepaalt de som van de oneven getallen van \"van\" t\/m \"tot\"\r\n\u00a0 \u00a0 If IsEven(van) Or IsEven(tot) Then\r\n\u00a0 \u00a0  \u00a0 SigmaOnevenVanTot = \"n.v.t.'\"\r\n\u00a0 \u00a0 Else\r\n\u00a0 \u00a0  \u00a0 SigmaOnevenVanTot = SigmaOneven(tot) - SigmaOneven(van - 2)\r\n\u00a0 \u00a0 End If\r\nEnd Function\r\n\r\nFunction SigmaEvenVanTot(ByVal van As Long, ByVal tot As Long) As Long\r\n\u00a0 \u00a0 If IsEven(van) And IsEven(tot) Then\r\n\u00a0 \u00a0  \u00a0 SigmaEvenVanTot = SigmaEven(tot) - SigmaEven(van - 2)\r\n\u00a0 \u00a0 Else\r\n\u00a0 \u00a0  \u00a0 SigmaEvenVanTot = \"n.v.t.\"\r\n\u00a0 \u00a0 End If\r\nEnd Function<\/span><\/code><\/pre>\n<\/div>\n<h3><a id=\"feestdagen\"><\/a>Feestdagen<\/h3>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b25382a\"  tabindex=\"0\" title=\"Pasen\"    >Pasen<\/span><div id=\"target-id6a8f89b25382a\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Pasen(ByVal jaar As Long) As Date<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">'gebruikt het algoritme van Meeus\/Jones\/Butcher<\/span>\r\n\r\n<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>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'maanstanden herhalen zich elke 19 jaar; a bepaalt waar in deze cyclus<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 a = jaar Mod 19<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'b bepaalt eeuwgetal (19 of 20 etc.)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 b = jaar \\ 100<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'c bepaalt jaar binnen de eeuw (78 of 26 etc.)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 c = jaar Mod 100<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'd, e, g berekenen correcties voor schrikkeljaren en kleine afwijkingen in maandcycli<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = b \\ 4<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 e = b Mod 4<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 g = (8 * b + 13) \\ 25<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'h, i, j bepalen de epacta, dit is de ouderdom van de maan op 1 januari van het jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 h = (11 * (b - d - g) - 4) \\ 30<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 i = (7 * a + h + 6) \\ 11<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'j geeft aantal dagen dat kerkelijke volle maan valt na 21 maart<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 j = (19 * a + (b - d - g) + 15 - i) Mod 29<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'k, l, m bepalen wanneer het de zondag na de volle maan is (daar Pasen op een zondag moet vallen)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 k = c \\ 4<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 l = c Mod 4<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 m = ((32 + 2 * e) + 2 * k - l - j) Mod 7<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'n bepaalt de maand (maart (3) of april (4))<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 n = (90 + (j + m)) \\ 25<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 'o bepaalt de dag in de maand<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 o = (19 + (j + m) + n) Mod 32<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Pasen = CDate(o &amp; \"-\" &amp; n &amp; \"-\" &amp; jaar) <\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b253838\"  tabindex=\"0\" title=\"Pinksteren\"    >Pinksteren<\/span><div id=\"target-id6a8f89b253838\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Pinksteren(ByVal jaar As Long) As Date<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d, p<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = HJG_Pasen(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = CDate(p)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = DateAdd(\"d\", 49, p)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Pinksteren = d <\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\n<p>Hemelvaart valt 10 dagen voor Pinksteren:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b253846\"  tabindex=\"0\" title=\"Hemelvaart\"    >Hemelvaart<\/span><div id=\"target-id6a8f89b253846\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Hemelvaart(ByVal jaar As Long) As Date<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d, p<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = Pinksteren(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 p = CDate(p)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d = DateAdd(\"d\", -10, p)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Hemelvaart = d <\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b253854\"  tabindex=\"0\" title=\"Moederdag\"    >Moederdag<\/span><div id=\"target-id6a8f89b253854\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Moederdag(ByVal jaar As Long) As Date<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(\"1-5-\" &amp; jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 2<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 1 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(\"d\", 1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Moederdag = DateAdd(\"d\", -1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\n<p>Vaderdag is op de derde zondag van juni:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b253861\"  tabindex=\"0\" title=\"Vaderdag\"    >Vaderdag<\/span><div id=\"target-id6a8f89b253861\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Vaderdag(ByVal jaar As Long) As Date<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(\"1-6-\" &amp; jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 3<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 1 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(\"d\", 1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Vaderdag = DateAdd(\"d\", -1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\n<p>En Prinsjesdag valt op de derde dinsdag van September:<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b25386e\"  tabindex=\"0\" title=\"Prinsjesdag\"    >Prinsjesdag<\/span><div id=\"target-id6a8f89b25386e\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function Prinsjesdag(ByVal jaar As Long) As Date<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim sd As Date<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim wd As Integer<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim teller As Integer<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sd = CDate(\"1-9-\" &amp; jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 teller = 0<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Do While teller &lt; 3<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 wd = Weekday(sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If wd = 3 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 teller = teller + 1<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 sd = DateAdd(\"d\", 1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Loop<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Prinsjesdag = DateAdd(\"d\", -1, sd)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b25387c\"  tabindex=\"0\" title=\"Feest_Sorteer\"    >Feest_Sorteer<\/span><div id=\"target-id6a8f89b25387c\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Private Sub Feest_Sorteer(ByRef opl() As String)<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim d1, d2<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim i, j<\/span>\r\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>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d1 = UBound(opl, 1)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 d2 = UBound(opl, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 For j = 1 To d1<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For i = 1 To d1 - 1<\/span>\r\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>\r\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>\r\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>\r\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>\r\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>\r\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>\r\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>\r\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>\r\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>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next i<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Next j<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Sub<\/span><\/code><\/pre>\n<\/div>\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><em><span class=\"collapseomatic \" id=\"id6a8f89b25388d\"  tabindex=\"0\" title=\"Feestdagen\"    >Feestdagen<\/span><div id=\"target-id6a8f89b25388d\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Function FeestDagen(ByVal jaar As Long, Optional Uitgebreid As Boolean = False)<\/span>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim dagen As String, dag As String<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim vpasen, vpinksteren, vhemelvaart<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Dim vnieuwjaar, vkoning, vkerst, vbevrijding<\/span>\r\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>\r\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>\r\n\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dagen = \"zomadiwodovrza\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"1-1-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vnieuwjaar = \"1-1-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 1) = \"Nieuwjaar\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(1, 3) = vnieuwjaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">  \u00a0 vpasen = Pasen(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vpasen)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 1) = \"Pasen\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(2, 3) = vpasen<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">  \u00a0 vhemelvaart = Hemelvaart(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vhemelvaart)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 1) = \"Hemelvaart\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(3, 3) = vhemelvaart<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">  \u00a0 vpinksteren = Pinksteren(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(vpinksteren)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 1) = \"Pinksteren\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(4, 3) = vpinksteren<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"25-12-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vkerst = \"25-12-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 1) = \"Kerst\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(5, 3) = vkerst<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If jaar &lt; 2014 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"30-4-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = \"30-4-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If dag = \"zo\" Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"29-4-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = \"29-4-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"27-4-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 vkoning = \"27-4-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 If dag = \"zo\" Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"26-4-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 vkoning = \"26-4-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If jaar &lt; 2014 Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 opl(6, 1) = \"Koninginnedag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 opl(6, 1) = \"Koningsdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(6, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(6, 3) = vkoning<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 dag = Mid(dagen, 2 * Weekday(CDate(\"5-5-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 vbevrijding = \"5-5-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 1) = \"Bevrijdingsdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 2) = dag<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 opl(7, 3) = vbevrijding<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Dim i As Integer, j As Integer<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 For i = 1 To 7<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 For j = 1 To 3<\/span>\r\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>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Next j<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Next i<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 1) = \"Goede vrijdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 2) = \"vr\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(8, 3) = DateAdd(\"d\", -2, vpasen)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 1) = \"Tweede paasdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 2) = \"ma\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(9, 3) = DateAdd(\"d\", 1, vpasen)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 1) = \"Tweede pinksterdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 2) = \"ma\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(10, 3) = DateAdd(\"d\", 1, vpinksteren)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 1) = \"Tweede kerstdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 2) = Mid(dagen, 2 * Weekday(CDate(\"26-12-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(11, 3) = \"26-12-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 1) = \"Oudejaarsdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 2) = Mid(dagen, 2 * Weekday(CDate(\"31-12-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(12, 3) = \"31-12-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 1) = \"Drie Koningen\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 2) = Mid(dagen, 2 * Weekday(CDate(\"6-1-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(13, 3) = \"6-1-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 1) = \"Carnaval\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 2) = Mid(dagen, 2 * Weekday(DateAdd(\"ww\", -7, vpasen)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(14, 3) = DateAdd(\"ww\", -7, vpasen)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 1) = \"Dodenherdenking\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 2) = Mid(dagen, 2 * Weekday(CDate(\"4-5-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(15, 3) = \"4-5-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 1) = \"Valentijnsdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 2) = Mid(dagen, 2 * Weekday(CDate(\"14-2-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(16, 3) = \"14-2-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 1) = \"Sinterklaas\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 2) = Mid(dagen, 2 * Weekday(CDate(\"5-12-\" &amp; jaar)) - 1, 2)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(17, 3) = \"5-12-\" &amp; jaar<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 1) = \"Moederdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 2) = \"zo\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(18, 3) = Moederdag(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 1) = \"Vaderdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 2) = \"zo\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(19, 3) = Vaderdag(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 1) = \"Prinsjesdag\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 2) = \"di\"<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 oplext(20, 3) = Prinsjesdag(jaar)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Feest_Sorteer oplext<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 Feest_Sorteer opl<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 If Uitgebreid Then<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 FeestDagen = oplext<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 Else<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 \u00a0 \u00a0 FeestDagen = opl<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 End If<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">End Function<\/span><\/code><\/pre>\n<\/div>\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<pre><code><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">ramdate=Int((Jaar - 1900) * 354.367 + 1421.44)<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">If Jaar &lt; 1997 Then <\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sprong = -366<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">If Jaar &gt; 2030 Then <\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 sprong = 365<\/span>\r\n<span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt;\">Ramadan = ramdate + sprong<\/span><\/code><\/pre>\n<p>Het Suikerfeest is 30 dagen later en het Offerfeest 98 dagen later.<\/p>\n<h3><a id=\"astronomie\"><\/a>Astronomie<\/h3>\n<p>Omdat ons universum zo ontzettend groot is zijn aardse afstanden niet handig om in de astronomie te gebruiken. De kilometers lopen al snel uit op zeer grote getallen.<\/p>\n<p>Daarom gebruiken astronomen het lichtjaar en de parsec als eenheden voor afstanden.<\/p>\n<h5>Lichtjaar<\/h5>\n<p>De eenheid lichtjaar is gedefinieerd als de afstand die het licht in vacu\u00fcm in 1 jaar aflegt.<\/p>\n<p>Hiervoor is het belangrijk te weten wat de snelheid van licht in vacu\u00fcm is en hoe lang een jaar precies duurt.<\/p>\n<p>De snelheid van licht in vacu\u00fcm bedraagt 299.792.458 (tweehonderdnegenennegentig miljoen zevenhonderdtweeennegentigduizend vierhonderdachtenvijftig) m\/s.<\/p>\n<p>Met een jaar wordt een jaar volgens de Juliaanse kalender bedoeld en is 365,25 dagen.<\/p>\n<p>We moeten dus weten hoeveel seconden er in 1 Juliaans jaar zitten zodat we daarna dit getal met de snelheid van het licht kunnen vermenigvuldigen om te weten hoelang een lichtjaar is.<\/p>\n<p>Dit is: 365,25 \u00d7 24 \u00d7 60 \u00d7 60 \u00d7 299.792.458 =<br \/>\n9.460.730.472.580.800 (negen biljard vierhonderdzestig biljoen zevenhonderddertig miljard vierhonderdtweeenzeventig miljoen vijfhonderdtachtigduizend achthonderd) meter ofwel<br \/>\n9.460.730.472.580,8 (negen biljoen vierhonderdzestig miljard zevenhonderddertig miljoen vierhonderdtweeenzeventigduizend vijfhonderdtachtig) km.<\/p>\n<p>Om aan te geven hoe ver een lichtjaar is kijken we even naar de Voyager 1. Dit is een ruimtezonde die al bijna een halve eeuw vanaf de aarde de ruimte in vliegt.<br \/>\nDe Voyager 1 is nu zo&#8217;n 26 biljoen km bij de aarde vandaan. Dit komt overeen met 0,002748202 lichtjaar en dat is iets meer dan 1 lichtdag!<\/p>\n<p>In Excel kun je nu twee UDF&#8217;s maken die een afstand in aardse grootheden omzet naar lichtjaren en andersom.<\/p>\n<p>De UDF Metric2Lichtjaar heeft als parameters de grootte in aardse eenheden (mm, cm, dm ,m ,dam, hm, km) en de betreffende eenheid (als string) die default &#8220;km&#8221; is.<\/p>\n<p>De UDF Lichtjaar2Metric heeft als parameters het aantal lichtjaren en wederom een optionele parameter waar de aardse eenheid als string kan worden aangegeven met de default waarde &#8220;km&#8221;.<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b25389e\"  tabindex=\"0\" title=\"Metric-Lichtjaar UDF&#039;s\"    >Metric-Lichtjaar UDF's<\/span><div id=\"target-id6a8f89b25389e\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code>Function Metric2Lichtjaar(ByVal grootte As Variant, Optional ByVal eenheid As String = \"km\") As Variant\r\n    '299792.458 km\/s = snelheid licht in vacuum\r\n    Dim AantSec As Double\r\n    Dim lj As Variant\r\n    \r\n    AantSec = CDbl(3600 * 365.25) * 24\r\n    lj = AantSec * 299792.458\r\n    Select Case LCase(eenheid)\r\n        Case \"mm\"\r\n            grootte = grootte \/ 1000000\r\n        Case \"cm\"\r\n            grootte = grootte \/ 100000\r\n        Case \"dm\"\r\n            grootte = grootte \/ 10000\r\n        Case \"m\"\r\n            grootte = grootte \/ 1000\r\n        Case \"dam\"\r\n            grootte = grootte \/ 100\r\n        Case \"hm\"\r\n            grootte = grootte \/ 10\r\n        Case \"km\"\r\n            grootte = grootte \/ 1\r\n        Case Else\r\n            grootte = -1\r\n    End Select\r\n    If grootte &gt; 0 Then\r\n        Metric2Lichtjaar = grootte \/ lj\r\n    Else\r\n        Metric2Lichtjaar = \"#N\/B#\"\r\n    End If    \r\nEnd Function\r\n\r\nFunction Lichtjaar2Metric(ByVal grootte As Variant, Optional ByVal eenheid As String = \"km\") As Variant\r\n    '299792.458 km\/s = snelheid licht in vacuum\r\n    Dim AantSec As Double\r\n    Dim lj As Variant\r\n    \r\n    AantSec = CDbl(3600 * 365.25) * 24\r\n    lj = AantSec * 299792.458\r\n    Select Case LCase(eenheid)\r\n        Case \"mm\"\r\n            grootte = grootte * 1000000\r\n        Case \"cm\"\r\n            grootte = grootte * 100000\r\n        Case \"dm\"\r\n            grootte = grootte * 10000\r\n        Case \"m\"\r\n            grootte = grootte * 1000\r\n        Case \"dam\"\r\n            grootte = grootte * 100\r\n        Case \"hm\"\r\n            grootte = grootte * 10\r\n        Case \"km\"\r\n            grootte = grootte * 1\r\n        Case Else\r\n            grootte = -1\r\n    End Select\r\n    If grootte &gt; 0 Then\r\n        Lichtjaar2Metric = grootte * lj\r\n    Else\r\n        Lichtjaar2Metric = \"#N\/B#\"\r\n    End If\r\nEnd Function<\/code><\/pre>\n<\/div>\n<h5>Parsec<\/h5>\n<p>Omdat ook een lichtjaar wat aan de kleine kant is werkt men in de astronomie ook met de Parsec (of eigenlijk meer met de Mega Parsec).<\/p>\n<p>Voor een uitgebreide uitleg over de Parsec verwijs ik graag naar het internet.<\/p>\n<p>De wiskundige definitie van een Parsec luidt:<\/p>\n<p>Een Parsec is de lengte van de aanliggende zijde van een rechthoekige driehoek waarvan de overstaande zijde 1 Astronomische Eenheid (AE) bedraagt en de aanliggende hoek 1 boogseconde (1&#8243;) is:<\/p>\n<p><a href=\"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2856 size-large\" src=\"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1024x308.png\" alt=\"\" width=\"580\" height=\"174\" srcset=\"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1024x308.png 1024w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-300x90.png 300w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-768x231.png 768w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1536x462.png 1536w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-2048x616.png 2048w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1200x361.png 1200w, https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1980x595.png 1980w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Een Astronomische Eenheid is de gemiddelde afstand tussen de Aarde (A) en de Zon (Z) en is ongeveer 150.000.000 (honderdvijftig miljoen) km. Maar voor de berekening van een Parsec is &#8220;ongeveer&#8221; niet voldoende en is de AE gelijk aan 149.597.870.700 (honderdnegenenveertig miljard vijfhonderdzevenennegentig miljoen achthonderdzeventigduizend zevenhonderd) m.<\/p>\n<p>We zijn gewend om hoeken in graden (of radialen) te meten waarbij een hoek tussen de 0\u00b0 en 360\u00b0 is.<\/p>\n<p>Maar een graad kan ook nog verder worden onderverdeeld in uren en seconden. Zo bestaat 1\u00b0 uit 60 (graad)minuten (60&#8242;) en 1 (graad)minuut bestaat uit 60 (graad)seconden (60&#8243;).<br \/>\nDus 1\u00b0 bestaat uit 3600 (graad)seconden.<\/p>\n<p>En nu we dit allemaal weten kunnen we met de tan(gus) de grootte van de Parsec berekenen:<\/p>\n<p>1 Parsec = 1 AE \/ tan(1\/3600\u00b0) = 30.856.775.814.671.900 (dertig biljard achthonderdzesenvijftig biljoen zevenhonderdvijfenzeventig miljard achthonderdveertien miljoen zeshonderdeenenzeventigduizend negenhonderd) m.<\/p>\n<p>De verhouding tussen de Parsec en het Lichtjaar bedraagt 3,261564, dus 1 Parsec = 3,261564 Lichtjaar.<\/p>\n<p>Een MegaParsec is 1 miljoen Parsec.<\/p>\n<p>De volgende 4 UDF berekenen respectievelijk Aardse eenheden naar Parsec (Metric2Parsec) en andersom (Parsec2Metric), Lichtjaar naar Parsec (Lichtjaar2Parsec) en andersom (Parsec2Lichtjaar). De parameters zij hiervoor al besproken.<\/p>\n<p><em><span class=\"collapseomatic \" id=\"id6a8f89b2538b4\"  tabindex=\"0\" title=\"Parsec UDF&#039;s\"    >Parsec UDF's<\/span><div id=\"target-id6a8f89b2538b4\" class=\"collapseomatic_content \"><\/em><\/p>\n<pre><code>Function Metric2Parsec(ByVal grootte As Variant, Optional ByVal eenheid As String = \"km\") As Variant\r\n    Const factor As Single = 3.261564\r\n    \r\n    Metric2Parsec = Metric2Lichtjaar(grootte, eenheid) \/ factor\r\nEnd Function\r\n\r\nFunction Parsec2Metric(ByVal grootte As Variant, Optional ByVal eenheid As String = \"km\") As Variant\r\n    Const factor As Single = 3.261564\r\n    \r\n    Parsec2Metric = Lichtjaar2Metric(grootte, eenheid) * factor\r\nEnd Function\r\n\r\nFunction Lichtjaar2Parsec(ByVal lichtjaar As Variant) As Variant\r\n    Const factor As Single = 3.261564\r\n    \r\n    Lichtjaar2Parsec = lichtjaar \/ factor\r\nEnd Function\r\n\r\nFunction Parsec2Lichtjaar(ByVal parsec As Variant) As Variant\r\n    Const factor As Single = 3.261564\r\n    \r\n    Parsec2Lichtjaar = parsec * factor\r\nEnd Function<\/code><\/pre>\n<\/div>\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.3 - 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-25T08:36:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2295\" \/>\n\t<meta property=\"og:image:height\" content=\"690\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data1\" content=\"10 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\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wiskunst.nl\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/parsec-1024x308.png\",\"datePublished\":\"2026-08-06T09:37:54+00:00\",\"dateModified\":\"2026-08-25T08:36:49+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\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/wiskunst.nl\\\/index.php\\\/programmeren1\\\/programmeren-in-excel\\\/wiskundige-functies\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wiskunst.nl\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/parsec.png\",\"contentUrl\":\"https:\\\/\\\/wiskunst.nl\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/parsec.png\",\"width\":2295,\"height\":690},{\"@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-25T08:36:49+00:00","og_image":[{"width":2295,"height":690,"url":"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Geschatte leestijd":"10 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"},"primaryImageOfPage":{"@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/#primaryimage"},"image":{"@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/#primaryimage"},"thumbnailUrl":"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec-1024x308.png","datePublished":"2026-08-06T09:37:54+00:00","dateModified":"2026-08-25T08:36:49+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":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/wiskunst.nl\/index.php\/programmeren1\/programmeren-in-excel\/wiskundige-functies\/#primaryimage","url":"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec.png","contentUrl":"https:\/\/wiskunst.nl\/wp-content\/uploads\/2026\/08\/parsec.png","width":2295,"height":690},{"@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":66,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2752\/revisions"}],"predecessor-version":[{"id":2877,"href":"https:\/\/wiskunst.nl\/index.php\/wp-json\/wp\/v2\/pages\/2752\/revisions\/2877"}],"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}]}}