C:\Monarch DemoN WintonD/M/Y50D,DT,T.0falsefalseASCIItruefalsefalsetop
false1674457662997761671193514680224842144083888638421504167335258388736126486417566335167281923276842108162551676083116777215148034259934743<font face="Verdana" size="12"/>DefaultC:\Documents and Settings\All Users\Documents\Monarch\Models\UserDefinedFunctions.xmodWarehouse5C116L11511Project Number7C216L11717Project Description13C318L1113115Book Date8D1410L1110132Order Numberx13Ctrue613L1113143Line Number3C73L113158Book Qty18N0109R119172Book Value18N211115R1113182Week Entered18N01215R113196Current Week18N01315R1131103Work Type12C819L11121111Work Area9C99L1191124Demo120Ctrue1420L"Work Area"Demo220Ctrue1520L"Work Type"Demo320Ctrue1620L"Project Description"Table Total20Ctrue1720L"Table Total"Order Number20C520Ltrim([Order Numberx])Demo430Ctrue1830L" Assuming costs at 75%"By Type OriginalTable Total OriginalTABLE_TO01<total text_color="8" fill_color="0"/></color><filter default="true"/><total insert="false"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Table Total</name><display_length>20</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="7" style="B"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Table Total</key_field></group></groups><default text_color="8" fill_color="7" style="B"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure></summary><summary><name>Table Total</name><short_name>TABLE_TOTA</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="0"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="0"/></color><filter default="true"/><total insert="false"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Table Total</name><title>Warehouse20truefalsefalsefalsefalsefalse14Table TotalSUM([Book Value])Summary Data OriginalSUMMARY_01<total text_color="8" fill_color="6" style="B"/></color><filter default="true"/><total insert="true" label="Summary by Warehouse"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Warehouse</name><display_length>10</display_length><color><values>true</values><subtotals>true</subtotals><default text_color="8" fill_color="6"/><total text_color="8" fill_color="6" style="B"/><header text_color="8" fill_color="0" style="B"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header label=" Summary to Show Book Value Costs and Profit">true</insert_header><insert_subtotal label="Subtotal for" include_key_align="R">true</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Project Number</name><display_length>13</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Order Number</name><display_length>20</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Demo4</name><display_length>20</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="6"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Warehouse</key_field></group><group type="G"/></groups><default text_color="8" fill_color="6" style="B"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Warehouse</key_field></group><group type="G"/></groups><default text_color="8" fill_color="6" style="B"/></color><calculation><expression>SUM([Book Value])*.75</expression></calculation></measure><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Warehouse</key_field></group><group type="G"/></groups><default text_color="8" fill_color="6" style="B"/></color><calculation><expression>SUM([Book Value])-(sum([book value])*.75)</expression></calculation></measure></summary><summary><name>Summary Data</name><short_name>SUMMARY_DA</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="6"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="6" style="B"/></color><filter default="true"/><total insert="true" label="Summary by Warehouse"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Warehouse</name><display_length>10</display_length><color><values>true</values><subtotals>true</subtotals><default text_color="8" fill_color="6"/><total text_color="8" fill_color="6" style="B"/><header text_color="8" fill_color="0" style="B"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header label=" Summary to Show Book Value Costs and Profit">true</insert_header><insert_subtotal label="Subtotal for" include_key_align="R">true</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Project Number</name><display_length>13</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Order Number</name><display_length>20</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Demo4</name><title>Work Type20truefalsefalsefalsefalsefalse14WarehouseProject NumberOrder NumberWarehouseProject NumberWarehouseSUM([Book Value])Week Entered14WarehouseProject NumberOrder NumberWarehouseProject NumberWarehouseSUM([Book Value])*.75Current Week14WarehouseProject NumberOrder NumberWarehouseProject NumberWarehouseSUM([Book Value])-(sum([book value])*.75)By Area OriginalBY_AREA_OR<total text_color="8" fill_color="2"/></color><filter default="true"/><total insert="true" label="Summary for Work Area"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo1</name><display_length>20</display_length><color><values>true</values><suppressed_duplicates>true</suppressed_duplicates><default text_color="8" fill_color="2"/><header text_color="8" fill_color="2"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>true</suppress_duplicates><insert_header label="" include_key_align="R">true</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Work Area</name><display_length>13</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="0"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Demo1</key_field><key_field>Work Area</key_field></group><group type="K"><key_field>Demo1</key_field></group><group type="G"/></groups><default text_color="8" fill_color="2"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure></summary><summary><name>By Area</name><short_name>BY_AREA</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="0"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="2"/></color><filter default="true"/><total insert="true" label="Summary for Work Area"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo1</name><title>Warehouse20truetrue
truetruefalsefalsefalseWork AreaProject Number13truefalsefalsefalsefalsefalse14Demo1Work AreaDemo1SUM([Book Value])
By Type OriginalBY_TYPE_OR<total text_color="8" fill_color="3"/></color><filter default="true"/><total insert="true" label="Summary for Type"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo2</name><display_length>20</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="3"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header label="Subtotals for" include_key_align="R">true</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Work Type</name><display_length>15</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="3"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Demo2</key_field><key_field>Work Type</key_field></group><group type="K"><key_field>Demo2</key_field></group><group type="G"/></groups><default text_color="8" fill_color="3"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure></summary><summary><name>By Type</name><short_name>BY_TYPE</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="0"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="3"/></color><filter default="true"/><total insert="true" label="Summary for Type"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo2</name><title>Warehouse20truefalsetruefalsefalsefalseWork TypeProject Number15truefalsefalsefalsefalsefalse14Demo2Work TypeDemo2SUM([Book Value])Project Description OriginalPROJECT_01<total text_color="8" fill_color="5"/></color><filter default="true"/><total insert="true" label="Summary for Projects"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo3</name><display_length>20</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>true</suppress_duplicates><insert_header label="Subtotals for" include_key_align="R">true</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Project Description</name><display_length>16</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Demo3</key_field><key_field>Project Description</key_field></group><group type="K"><key_field>Demo3</key_field></group><group type="G"/></groups><default text_color="8" fill_color="5"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure></summary><summary><name>Project Description</name><short_name>PROJECT_DE</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="0"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="5"/></color><filter default="true"/><total insert="true" label="Summary for Projects"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo3</name><title>Warehouse20truetruefalsefalsefalseProject DescriptionProject Number16falsefalsefalsefalsefalse14Demo3Project DescriptionDemo3SUM([Book Value])Type By Area OriginalTYPE_BY_01<total text_color="8" fill_color="4"/></color><filter default="true"/><total insert="true" label="Summary for Type"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo2</name><display_length>20</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="4"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>true</suppress_duplicates><insert_header label="Subtotals for" include_key_align="R">true</insert_header><insert_subtotal label="Subtotal">true</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Work Type</name><display_length>15</display_length><color><entire_column>true</entire_column><default text_color="8" fill_color="4"/></color><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header label="">true</insert_header><insert_subtotal label="Subtotal for " include_key_align="R">true</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><key><name>Work Area</name><display_length>9</display_length><sort direction="A"><sort_by_self/></sort><matching><all/></matching><display across="false"><suppress_duplicates>false</suppress_duplicates><insert_header>false</insert_header><insert_subtotal>false</insert_subtotal><blank_line>false</blank_line><page_break>false</page_break></display></key><measure><display_length>14</display_length><color treat_null="N"><groups><group type="K"><key_field>Demo2</key_field><key_field>Work Type</key_field></group><group type="K"><key_field>Demo2</key_field></group><group type="G"/><group type="K"><key_field>Demo2</key_field><key_field>Work Type</key_field><key_field>Work Area</key_field></group></groups><default text_color="8" fill_color="4"/></color><calculation><expression>SUM([Book Value])</expression></calculation></measure></summary><summary><name>Type by Area</name><short_name>TYPE_BY_AR</short_name><font face="Arial" size="10"/><color><default text_color="8" fill_color="0"/><title text_color="8" fill_color="7"/><total text_color="8" fill_color="4"/></color><filter default="true"/><total insert="true" label="Summary for Type"/><state header_lines="1" data_lines="1"/><chart type="Bar (Vertical)" cluster="0"><three_d>false</three_d><joined>false</joined><stacked>false</stacked><h_grid>false</h_grid><v_grid>false</v_grid><force_zero>true</force_zero><same_y>true</same_y><display_values>false</display_values><legends stagger="false" width="5" height="1"/></chart><key><name>Demo2</name><title>Warehouse20truetruetruetruefalsefalseWork TypeProject Number15truetruetruetruetruefalsefalseWork AreaOrder Number12truefalsefalsefalsefalsefalse14Demo2Work TypeWork AreaDemo2Work TypeDemo2SUM([Book Value])
_WorkingDays_ComputeDaysOffInRangeThis is essentially a list of holidays that must be edited before starting to use the Working_Days user defined function. Here are the other user defined functions that also need to be edited before using Working_Days: _WorkingDays_FirstValidDateForWorkingDays _WorkingDays_IsWorkingDay _WorkingDays_LastValidDateForWorkingDays_WorkingDays_ComputeDaysOffInRange(startdate,enddate) Returns the number of days off in the range of dates from <1>startdate</1> to <2>enddate</2>. Days off are defined as days that would ordinarily be working days, but are not worked because they are holidays or vacation days. This must be edited before using the Working_Days user defined function.date
startdateenddate/* Compute the number of days off in the given range of dates. */ /* NOTE: Adjust the list below to account for your particular holidays, vacation days, etc. Be sure to also adjust the functions FirstValidDateForWorkingDays and LastValidDateForWorkingDays. */ ( /* 2006 */ _WorkingDays_DateIsWorkingDayInRange({2006-01-01}, startdate, enddate) /* New Year's day */ + _WorkingDays_DateIsWorkingDayInRange({2006-04-14}, startdate, enddate) /* Good Friday */ + _WorkingDays_DateIsWorkingDayInRange({2006-05-29}, startdate, enddate) /* Memorial day */ + _WorkingDays_DateIsWorkingDayInRange({2006-07-04}, startdate, enddate) /* The 4th of July */ + _WorkingDays_DateIsWorkingDayInRange({2006-09-04}, startdate, enddate) /* Labor day */ + _WorkingDays_DateIsWorkingDayInRange({2006-11-23}, startdate, enddate) /* Thanksgiving */ + _WorkingDays_DateIsWorkingDayInRange({2006-11-24}, startdate, enddate) /* Thanksgiving+1 */ + _WorkingDays_DateIsWorkingDayInRange({2006-12-25}, startdate, enddate) /* Christmas */ + _WorkingDays_DateIsWorkingDayInRange({2006-12-26}, startdate, enddate) /* Christmas+1 */ /* 2007 */ + _WorkingDays_DateIsWorkingDayInRange({2007-01-01}, startdate, enddate) /* New Year's day */ + _WorkingDays_DateIsWorkingDayInRange({2007-04-06}, startdate, enddate) /* Good Friday */ + _WorkingDays_DateIsWorkingDayInRange({2007-05-28}, startdate, enddate) /* Memorial day */ + _WorkingDays_DateIsWorkingDayInRange({2007-07-04}, startdate, enddate) /* The 4th of July */ + _WorkingDays_DateIsWorkingDayInRange({2007-09-03}, startdate, enddate) /* Labor day */ + _WorkingDays_DateIsWorkingDayInRange({2007-11-22}, startdate, enddate) /* Thanksgiving */ + _WorkingDays_DateIsWorkingDayInRange({2007-11-23}, startdate, enddate) /* Thanksgiving+1 */ + _WorkingDays_DateIsWorkingDayInRange({2007-11-24}, startdate, enddate) /* Christmas eve */ + _WorkingDays_DateIsWorkingDayInRange({2007-11-25}, startdate, enddate) /* Christmas */ )
_WorkingDays_ComputeNormalWorkingDaysInRange_WorkingDays_ComputeNormalWorkingDaysInRange(startdate,enddate) Returns the number of normal working days in the range of dates from <1>startdate</1> to <2>enddate</2>. Does not account for holidays or vacation days.date
startdateenddate/* Sum up the occurrences of all days that fall in the range, but only count contributions from work days. */ ( _WorkingDays_IsWorkingDay(1) * CountOccurrencesOfWeekdayInRange(1, startdate, enddate) + _WorkingDays_IsWorkingDay(2) * CountOccurrencesOfWeekdayInRange(2, startdate, enddate) + _WorkingDays_IsWorkingDay(3) * CountOccurrencesOfWeekdayInRange(3, startdate, enddate) + _WorkingDays_IsWorkingDay(4) * CountOccurrencesOfWeekdayInRange(4, startdate, enddate) + _WorkingDays_IsWorkingDay(5) * CountOccurrencesOfWeekdayInRange(5, startdate, enddate) + _WorkingDays_IsWorkingDay(6) * CountOccurrencesOfWeekdayInRange(6, startdate, enddate) + _WorkingDays_IsWorkingDay(7) * CountOccurrencesOfWeekdayInRange(7, startdate, enddate) )
_WorkingDays_ComputeWorkingDaysInRange_WorkingDays_ComputeWorkingDaysInRange(startdate,enddate) Returns the number of working days in the range of dates from <1>startdate</1> to <2>enddate</2>. This calculation takes into account holidays that fall on dates that what would otherwise be working days.
startdateenddate/* Compute working days on range from including startdate to but not including enddate. */ If (_WorkingDays_IsValidDateRangeForWorkingDays(startdate, enddate), _WorkingDays_ComputeNormalWorkingDaysInRange(startdate, enddate) - _WorkingDays_ComputeDaysOffInRange(startdate, enddate), 1/0 /* return a null value if the given range is invalid */ )
_WorkingDays_DateIsWorkingDayInRange_WorkingDays_DateIsWorkingDayInRange(date,startdate,enddate) Returns 1 if the given <1>date</1> falls on a work day that is in the range of dates from <2>startdate</2> to <3>enddate</3>. Returns 0 otherwise.
datestartdateenddate_WorkingDays_IsWorkingDay(Weekday(date)) * DateIsInRange(date, startdate, enddate)
_WorkingDays_FirstValidDateForWorkingDaysThis defines the first valid date for which the Working_Days user defined function works with. As the list of holidays is user defined, and may only cover a few years, this is a method to ensure the Working_Days function returns null if the date range falls outside the range for which holidays have been defined. Here are the other user defined functions that also need to be edited before using Working_Days: _WorkingDays_FirstValidDateForWorkingDays _WorkingDays_IsWorkingDay _WorkingDays_LastValidDateForWorkingDays _WorkingDays_IsWorkingDay _WorkingDays_LastValidDateForWorkingDays _WorkingDays_ComputeDaysOffInRange_WorkingDays_FirstValidDateForWorkingDays() Returns the first date that is valid for use in the WorkingDays function. This must be checked/edited before first using the WorkingDays function.
/* NOTE: Adjust this date when adjusting the list of holidays, vacation days, etc. in ComputeDaysOffInRange. */ {2006-01-01}
_WorkingDays_IsValidDateRangeForWorkingDays_WorkingDays_IsValidDateRangeForWorkingDays(startdate,enddate) Returns 1 if the range of dates from <1>startdate</1> to <2>enddate</2> is a valid range for use in the WorkingDays function. Returns 0 otherwise.
startdateenddate/* Returns 1 if the given range of dates lies completely within the range defined by FirstValidDateForWorkingDays and LastValidDateForWorkingDays. */ If (enddate < startdate, 1, /* An empty range, while un-interesting, is not considered to be invalid. */ If (startdate < _WorkingDays_FirstValidDateForWorkingDays() .Or. startdate > _WorkingDays_LastValidDateForWorkingDays(), 0, /* Range starts before the first or after the last valid date. */ If (enddate > _WorkingDays_LastValidDateForWorkingDays()+1, 0, /* Range ends after the last valid date. */ 1 /* Range is valid. */ ) ) )
_WorkingDays_IsWorkingDayThis defines the days which are to be normal considered working days for use with the Working_Days user-defined function. Currently it is set to Monday to Friday. This must be edited before using the Working_Days function if your normal working days are not Monday to Friday. Here are the other user defined functions that also need to be edited before using Working_Days: _WorkingDays_FirstValidDateForWorkingDays _WorkingDays_LastValidDateForWorkingDays _WorkingDays_ComputeDaysOffInRange_WorkingDays_IsWorkingDay(weekday) Returns 1 if the given <1>weekday</1> (1=Sunday, 2=Monday, etc.) is normally a work day, else returns 0. This must be checked/edited before first using the WorkingDays function. It is currently set to a work week of Monday to Friday.date
weekday/* NOTE: Adjust the list of weekdays in the following expression to describe your particular work week. 1 is Sunday and 7 is Saturday*/ If (weekday .In.(2,3,4,5,6), 1, 0)
_WorkingDays_LastValidDateForWorkingDaysThis defines the last valid date for which the Working_Days user defined function works with. As the list of holidays is user defined, and may only cover a few years, this is a method to ensure the Working_Days function returns null if the date range falls outside the range for which holidays have been defined. Here are the other user defined functions that also need to be edited before using Working_Days: _WorkingDays_FirstValidDateForWorkingDays _WorkingDays_IsWorkingDay _WorkingDays_ComputeDaysOffInRange_WorkingDays_LastValidDateForWorkingDays() Returns the last date that is valid for use in the WorkingDays user-defined function. This must be checked/edited before first using the WorkingDays function.
/* NOTE: Adjust this date when adjusting the list of holidays, vacation days, etc. in ComputeDaysOffInRange. */{2007-12-31}
Char_XLChar_XL(number)Returns the character specified by the code <1>number</1> from the character set for your computer. This is an Excel function name for the intrinsic function CHR.string
numberChr(number)
Check_CCCheck_CC(CCNumber)This checks a <1>string representing a credit card number</1> against the Luhn or MOD 10 formula. Note this only works for 13, 14, 15 and 16 digit numbers. Returns 1 if the number is valid, otherwise returns 0. NOTE, this should only be used as a mechanism for assisting in trapping simple data entry errors, not as a validation technique to avoid fraudstringspecial
CCNumberif(len(CCNumber)=16 .Or. len(CCNumber)=14, /*Works for 16 digit credit cards*/ /*Start result check*/ if( /*Start the mod expression - returns 1 if card is valid*/ Mod( /*1st digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,1,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,1,1))))),2,1)) + /*Add 2nd digit*/ Val(Substr(CCNumber,2,1)) + /*3rd digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,3,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,3,1))))),2,1)) + /*4th digit*/ Val(Substr(CCNumber,4,1)) + /*Get 5th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,5,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,5,1))))),2,1)) + /*Add 6th digit*/ Val(Substr(CCNumber,6,1)) + /*Get result of 7th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,7,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,7,1))))),2,1)) + /*Add 8th digit*/ Val(Substr(CCNumber,8,1)) + /*Get result of 9th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,9,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,9,1))))),2,1)) + /*Add 10th digit*/ Val(Substr(CCNumber,10,1)) + /*Get result of 11th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,11,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,11,1))))),2,1)) + /*Add 12th digit*/ Val(Substr(CCNumber,12,1)) + /*Get result of 13th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,13,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,13,1))))),2,1)) + /*Add 14th digit*/ Val(Substr(CCNumber,14,1)) + /*Get result of 15th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,15,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,15,1))))),2,1)) + /*Add 16th digit*/ Val(Substr(CCNumber,16,1)) /*End Mod expression for 16 digit cards*/ ,10)=0,1,0) /*end result check for 14/16 digit cards*/ , if(len(CCNumber)=15 .Or.len(CCNumber)=13 , /*Start the mod expression - returns 1 if card is valid*/ if( mod( /*Add 1st digit*/ Val(Substr(CCNumber,1,1)) + /*Get result of 2nd digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,2,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,2,1))))),2,1)) + /*Add 3rd digit*/ Val(Substr(CCNumber,3,1)) + /*Get result of 4th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,4,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,4,1))))),2,1)) + /*Add 5th digit*/ Val(Substr(CCNumber,5,1)) + /*Get result of 6th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,6,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,6,1))))),2,1)) + /*Add 7th digit*/ Val(Substr(CCNumber,7,1)) + /*Get result of 8th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,8,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,8,1))))),2,1)) + /*Add 9th digit*/ Val(Substr(CCNumber,9,1)) + /*Get result of 10th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,10,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,10,1))))),2,1)) + /*Add 11th digit*/ Val(Substr(CCNumber,11,1)) + /*Get result of 12th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,12,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,12,1))))),2,1)) + /*Add 13th digit*/ Val(Substr(CCNumber,13,1)) + /*Get result of 14th digit*/ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,14,1))))),1,1))+ Val(Substr(Trim(Str((2*Val(Substr(CCNumber,14,1))))),2,1)) + Val(Substr(CCNumber,15,1)) /*End Mod expression for 15 digit cards*/ ,10)=0,1,0) /*Return 1 for card lengths that are not 13/15 or 14/16*/ ,0))
Check_NHSNumberCheck_NHSNumber(NHSNumber)Checks a UK NHS Number using the rules in http://www.govtalk.gov.uk/gdsc/html/noframes/NHSnumber-2-0-Release.htm. Returns 1 if the number is valid, otherwise returns 0. NOTE, this should only be used as a mechanism for assisting in trapping simple data entry errors, not as a validation technique to avoid fraudnumericspecial
NHSNumberif(len(trim(Str(NHSNumber)))<>10,0, if( 11-( mod( ((Val(Substr(Str(NHSNumber,10,0,),1,1))*10)+ (Val(Substr(Str(NHSNumber,10,0,),2,1))*9)+ (Val(Substr(Str(NHSNumber,10,0,),3,1))*8)+ (Val(Substr(Str(NHSNumber,10,0,),4,1))*7)+ (Val(Substr(Str(NHSNumber,10,0,),5,1))*6)+ (Val(Substr(Str(NHSNumber,10,0,),6,1))*5)+ (Val(Substr(Str(NHSNumber,10,0,),7,1))*4)+ (Val(Substr(Str(NHSNumber,10,0,),8,1))*3)+ (Val(Substr(Str(NHSNumber,10,0,),9,1))*2)),11))=10,0, if( 11-( mod( ((Val(Substr(Str(NHSNumber,10,0,),1,1))*10)+ (Val(Substr(Str(NHSNumber,10,0,),2,1))*9)+ (Val(Substr(Str(NHSNumber,10,0,),3,1))*8)+ (Val(Substr(Str(NHSNumber,10,0,),4,1))*7)+ (Val(Substr(Str(NHSNumber,10,0,),5,1))*6)+ (Val(Substr(Str(NHSNumber,10,0,),6,1))*5)+ (Val(Substr(Str(NHSNumber,10,0,),7,1))*4)+ (Val(Substr(Str(NHSNumber,10,0,),8,1))*3)+ (Val(Substr(Str(NHSNumber,10,0,),9,1))*2)),11))=11,if(Right(Str(NHSNumber,10,0,),1)<>"0",0,1), if( 11-( mod( ((Val(Substr(Str(NHSNumber,10,0,),1,1))*10)+ (Val(Substr(Str(NHSNumber,10,0,),2,1))*9)+ (Val(Substr(Str(NHSNumber,10,0,),3,1))*8)+ (Val(Substr(Str(NHSNumber,10,0,),4,1))*7)+ (Val(Substr(Str(NHSNumber,10,0,),5,1))*6)+ (Val(Substr(Str(NHSNumber,10,0,),6,1))*5)+ (Val(Substr(Str(NHSNumber,10,0,),7,1))*4)+ (Val(Substr(Str(NHSNumber,10,0,),8,1))*3)+ (Val(Substr(Str(NHSNumber,10,0,),9,1))*2)),11))=Val(Right(Str(NHSNumber,10,0,),1)),1,0))))
Check_NINumberCheck_NINumber(NINumber)This is a simple verification check for UK National Insurance Numbers. Returns 1 if the number is valid, otherwise returns 0. NOTE, this should only be used as a mechanism for assisting in trapping simple data entry errors, not as a validation technique to avoid fraud. Taken from information at http://www.govtalk.gov.uk/gdsc/html/frames/NationalInsuranceNumber-2-1-Release.htmstringspecial
NINumberif(Len(strip(NINumber," "))<8,0, if(Len(strip(NINumber," "))=9 .And. len(strip(Right(strip(NINumber," "),1),"ABCD"))<>0,0, if(Len(strip(NINumber," "))>9,0, if(Isalpha(substr(strip(NINumber," "),1,1))=0 .Or.Isalpha(substr(strip(NINumber," "),2,1))=0 ,0, if(Substr(strip(NINumber," "),1,1)="D",0, if(Substr(strip(NINumber," "),1,1)="F",0, if(Substr(strip(NINumber," "),1,1)="I",0, if(Substr(strip(NINumber," "),1,1)="Q",0, if(Substr(strip(NINumber," "),1,1)="U",0, if(Substr(strip(NINumber," "),1,1)="V",0, if(Substr(strip(NINumber," "),2,1)="D",0, if(Substr(strip(NINumber," "),2,1)="F",0, if(Substr(strip(NINumber," "),2,1)="I",0, if(Substr(strip(NINumber," "),2,1)="O",0, if(Substr(strip(NINumber," "),2,1)="Q",0, if(Substr(strip(NINumber," "),2,1)="U",0, if(Substr(strip(NINumber," "),2,1)="V",0, if(Substr(strip(NINumber," "),1,2)="GB",0, if(Substr(strip(NINumber," "),1,2)="BG",0, if(Substr(strip(NINumber," "),1,2)="NK",0, if(Substr(strip(NINumber," "),1,2)="KN",0, if(Substr(strip(NINumber," "),1,2)="TN",0, if(Substr(strip(NINumber," "),1,2)="NT",0, if(Substr(strip(NINumber," "),1,2)="ZZ",0, if(len(Strip(Substr(strip(NINumber," "),3,6),"0123456789"))<>0,0, 1)))))))))))))))))))))))))
Check_SSNCheck_SSN(ssn)Performs very simple US Social Security Number verification on a character string representing the SSN. Returns 1 if the number is valid, otherwise returns 0. NOTE, this should only be used as a mechanism for assisting in trapping simple data entry errors, not as a validation technique to avoid fraud. Official tools for employers are available at www.socialsecurity.gov/employer/ssnv.htmstringspecial
ssnif(Len(Strip(ssn,"-"))<>9,0, /*SSN must be 9 digits*/ if(left(Strip(ssn,"-"),3)="000",0,/*Area Number 000 will not be assigned*/ if(left(Strip(ssn,"-"),3)="666",0,/*Area Number 666 will not be assigned*/ if(val(left(Strip(ssn,"-"),3))>899,0,/*Area Numbers 900-999 will not be assigned*/ if(right(Strip(ssn,"-"),4)="0000",0,/*The last 4 digits "serial number" is never 0000*/ if(Strip(ssn,"-")="078051120",0,/*Invalid SSN used in a marketing campaign*/ 1))))))
Code_XLCode_XL(text)Returns a numeric code for the first character in a <1>text string</1>, in the character set used by your computer. This is an Excel function name for the intrinsic function ASC.string
textAsc(text)
Concatenate_XLConcatenate_XL()Joins several text strings into one text string. Limited to 12 strings. This is similar to the function in Excel. You can also join strings by using the + operator.string
text1text2text1+text2
text1text2text3text1+text2+text3
text1text2text3text4text1+text2+text3+text4
text1text2text3text4text5text1+text2+text3+text4+text5
text1text2text3text4text5text6text1+text2+text3+text4+text5+text6
text1text2text3text4text5text6text7text1+text2+text3+text4+text5+text6+text7
text1text2text3text4text5text6text7text8text1+text2+text3+text4+text5+text6+text7+text8
text1text2text3text4text5text6text7text8text9text1+text2+text3+text4+text5+text6+text7+text8+text9
text1text2text3text4text5text6text7text8text9text10text1+text2+text3+text4+text5+text6+text7+text8+text9+text10
text1text2text3text4text5text6text7text8text9text10text11text1+text2+text3+text4+text5+text6+text7+text8+text9+text10+text11
text1text2text3text4text5text6text7text8text9text10text11text12text1+text2+text3+text4+text5+text6+text7+text8+text9+text10+text11+text12
CountOccurrencesOfWeekdayInRangeCountOccurrencesOfWeekdayInRange(weekday,startdate,enddate) Returns the number of occurrences of the given <1>weekday</1> (1=Sunday, 2=Monday, etc.) that fall in the range of dates from <2>startdate</2> to <3>enddate</3>.
weekdaystartdateenddateIf (weekday < 1 .Or. weekday > 7 .Or. enddate < startdate, 0, /* bogus weekday or empty range */ If (enddate = startdate, If (Weekday(startdate) = weekday, 1, 0), /* range consists of a single day */ /* The total number of occurrences of the given day is the number of full weeks (possibly 0), plus 1 if the given day happens to fall in any leftover partial week. */ Age(startdate, enddate, 3) + Weekday_Is_In_Partial_Week(weekday, Weekday(startdate), Weekday(enddate)) ) )
Date_To_Unix_Time_NumberDate_To_Unix_Time_Number(date) This converts a <1>date</1> based on UTC to a Unix or Epoch Time Number. Note that Date/Time is only accurate to the second.dateconversion
date(date-{1970-01-01 00:00:00})*86400
DateIsInRangeDateIsInRange(date,startdate,enddate) Returns 1 if the given <1>date</1> is in the range of dates starting with and including <2>startdate</2> and ending with but not including <3>enddate</3>. Returns 0 if the given <1>date</1> is not in the range.date
datestartdateenddateIf (enddate < startdate, 0, /* range is empty */ If (enddate = startdate, If (date = startdate, 1, 0), /* range consists of a single day */ If (startdate <= date .And. date < enddate, 1, 0) /* range consists of days from start date up to but not including end date */ ) )
DateSerial1900DateSerial1900(date)Returns an Excel style date serial number for a given <1>date</1> based on the 1900 date system.dateconversion
date/*Check if the date is before the 28th Feb 1900*/ if(date<={1900-02-28}, /*No need to deal with incorrect leap year*/ date-{1899-12-31}, /*Date is after the incorrect leap year, so add 1*/ date-{1899-12-31}+1)
DateSerial1904DateSerial1904(date)Returns an Excel style date serial number for a given <1>date</1> based on the 1904 date system.dateconversion
datedate-{1904-01-01}
Display_NameDisplay_Name(First,Last[,Middle[,Title[,Suffix]]]) returns the full displayable name given the individual name pieces: <1>first name</1>, <2>last name</2>, <3>middle name or middle initial</3>, <4>title (e.g., "Mr")</4>, <5>suffix (e.g., "Jr")</5>string
FirstLastMiddleTitleSuffixIf(IsEmpty(Title),"",Title+" ") + First + If(IsEmpty(Middle),""," "+Substr(Middle,1,1)+".") + If(IsEmpty(Last) ,""," "+Last) + If(IsEmpty(Suffix),"",", "+Suffix)
FirstLastMiddleTitleDisplay_Name(First,Last,Middle,Title,"")
FirstLastMiddleDisplay_Name(First,Last,Middle,"","")
FirstLastDisplay_Name(First,Last,"","","")
End_Of_Current_MonthEnd_Of_Current_Month([input_date])Returns the date of the last day of the current month as a date for the specified <1>date</1>. If no date is specified, then the current date is assumed.date
Ctod(If(Month(today())=1,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,), If(Month(today())=3,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=4,"30"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=5,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=6,"30"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=7,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=8,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=9,"30"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=10,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=11,"30"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=12,"31"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0,""), If(Month(today())=2 .And. Right(Trim(Str(Year(today()),4)),2)="00", If(Mod(Year(today()),400)=0,"29"+"/"+Str(Month(today()),2,0)+"/"+Str(Year(today()),4,0,""),"28"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0)), If(Month(today())=2, If(Mod(Year(today()),4)=0,"29"+"/"+Str(Month(today()),2,0)+"/"+Str(Year(today()),4,0,""),"28"+"/"+Str(Month(today()),2,0,"0")+"/"+Str(Year(today()),4,0)), "31/12/1899"))))))))))))),"d/m/y")
input_dateCtod(If(Month(input_date)=1,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,), If(Month(input_date)=3,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=4,"30"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=5,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=6,"30"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=7,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=8,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=9,"30"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=10,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=11,"30"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=12,"31"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0,""), If(Month(input_date)=2 .And. Right(Trim(Str(Year(input_date),4)),2)="00", If(Mod(Year(input_date),400)=0,"29"+"/"+Str(Month(Input_Date),2,0)+"/"+Str(Year(Input_Date),4,0,""),"28"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0)), If(Month(input_date)=2, If(Mod(Year(input_date),4)=0,"29"+"/"+Str(Month(Input_Date),2,0)+"/"+Str(Year(Input_Date),4,0,""),"28"+"/"+Str(Month(Input_Date),2,0,"0")+"/"+Str(Year(Input_Date),4,0)), "31/12/1899"))))))))))))),"d/m/y")
End_Of_Previous_MonthEnd_Of_Previous_Month([input_date])Returns the date of the last day of the preceding month for an optional specified <1>date</1>. If no input date is specified, the date is assumed to be todays date.date
input_dateinput_date-Day(input_date)
Date()-Day(Date())
End_Of_Working_WeekEnd_Of_Working_Week(date)Returns the date of the last day of a working week of a specified date, assuming Monday is the start of the working week. If a date falls on a weekend, the last day is assumed to be the day 5 or 6 days later. If no date is specified, todays date is used.date
Date()-Weekday(Date(),2)+5
dateif(Weekday(Date,2)<=5, Date-Weekday(Date,2)+5,Date-Weekday(Date,2)+12)
Euro_To_Legacy_CurrencyEuro_To_Legacy_Currency(Euro_Amount,currency)Converts a <1>Euro amount</1> to a legacy currency amount that is now using the Euro. Valid <2>currency identifiers</2> are ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE and VAL. If an unknown currency is entered, the function returns null.numericconversion
Euro_AmountcurrencyIf(currency="BEF", euro_amount*40.3399, If(currency="GRD", euro_amount*340.750, If(currency="FRF", euro_amount*6.55957, If(currency="ITL", euro_amount*1936.27, If(currency="NLG", euro_amount*2.20371, If(currency="PTE", euro_amount*200.482, If(currency="DEM", euro_amount*1.95583, If(currency="ESP", euro_amount*166.386, If(currency="IEP", euro_amount*0.787564, If(currency="ATS", euro_amount*13.7603, If(currency="LUF", euro_amount*40.3399, If(currency="VAT", euro_amount*1936.27, If(currency="FIM", euro_amount*5.94573,1/0 )))))))))))))
Even_XLEven_XL(number)Rounds a positive number up and negative number down to the nearest even integer. This is an Excel function using the intrinsic functions Mod and Ceiling.numeric
numberif(number>0, if(Mod(Ceiling(number),2)=0 /*Even*/,Ceiling(number),Ceiling(number+1)) ,if(Mod(Ceiling(number),2)=0 /*Even*/,Ceiling(number),Ceiling(number-1)) )
Format_SSNFormat_SSN(ssn,format_type)Formats a US <1>Social Security Number</1>. To remove hyphens from a SSN, specify a <2>format type</2> of remove_hyphens, to add hyphens, specify a <2>format type</2> of add_hyphens.string
ssnformat_typeIf([format_type]="remove_hyphens",Strip(ssn,"-"), If([format_type]="add_hyphens", Substr(Strip(ssn,"- "),1,3)+"-"+ Substr(Strip(ssn,"- "),4,2)+"-"+ Substr(Strip(ssn,"- "),6,4) ,"" ))
JulianCalendarDate_To_DateJulianCalendarDate_To_Date(juliandate)Converts a <1>Julian Calendar Date</1>, e.g. 2450000 to a date. Note that this does not deal with fractions of a Julian Calendar date, i.e. times.dateconversion
juliandateCtod(Str(Int((Int(80*(Int((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)-Int(1461*(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001))/4)+31)) /2447))+2-12*(Int((Int(80*(Int((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)-Int(1461*(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001))/4) +31))/2447))/11))),2,0)+"/"+Str((Int((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)-Int(1461*(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001))/4)+31))-Int(2447*(Int(80*(Int((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)-Int(1461*(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001)) /4)+31))/2447))/80),2,0)+"/"+Str(Int(100*((Int((4*(Int(juliandate)+68569))/146097))-49)+(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001))+(Int((Int(80*(Int((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)-Int(1461*(Int(4000*((Int(juliandate)+68569)-Int((146097*(Int((4*(Int(juliandate)+68569))/146097))+3)/4)+1)/1461001))/4)+31))/2447))/11))),4,0))
Legacy_Currency_To_EuroLegacy_Currency_To_Euro(Legacy_Amount,currency)Converts a <1>legacy currency amount</1> that is now using the Euro to a Euro amount. Valid <2>currency identifiers</2> are ATS,BEF,DEM,ESP,FIM,FRF,GRD,IEP,ITL,LUF,NLG,PTE and VAL. If an unknown currency is entered, the function returns null.numericconversion
Legacy_AmountcurrencyIf(currency="BEF", legacy_amount/40.3399, If(currency="GRD", legacy_amount/340.750, If(currency="FRF", legacy_amount/6.55957, If(currency="ITL", legacy_amount/1936.27, If(currency="NLG", legacy_amount/2.20371, If(currency="PTE", legacy_amount/200.482, If(currency="DEM", legacy_amount/1.95583, If(currency="ESP", legacy_amount/166.386, If(currency="IEP", legacy_amount/0.787564, If(currency="ATS", legacy_amount/13.7603, If(currency="LUF", legacy_amount/40.3399, If(currency="VAT", legacy_amount/1936.27, If(currency="FIM", legacy_amount/5.94573,1/0 )))))))))))))
Mid_XLMid_XL(text,start_num,num_chars)Returns the characters from the middle of a <1>text string</1>, given a <2>starting position</2> and <3>length</3>. This is an Excel function name for the intrinsic function Substr.string
textstart_numnum_charsSubstr(text,start_num,num_chars)
MonthName_EngMonthName_Eng(date)Returns the English Month name for a specified <1>date</1>. E.g. 01/01/2007 would return January.date
dateif(Month(date)=1,"January", if(Month(date)=2,"February", if(Month(date)=3,"March", if(Month(date)=4,"April", if(Month(date)=5,"May", if(Month(date)=6,"June", if(Month(date)=7,"July", if(Month(date)=8,"August", if(Month(date)=9,"September", if(Month(date)=10,"October", if(Month(date)=11,"November", if(Month(date)=12,"December","*INVALID MONTH*"))))))))))))
Odd_XLOdd_XL(number)Rounds a positive number up and negative number down to the nearest odd integer. This is an Excel function using the intrinsic functions Mod and Ceiling.numeric
numberif(number>0, if(Mod(Ceiling(number),2)=0 /*Even*/,Ceiling(number+1),Ceiling(number)) ,if(Mod(Ceiling(number),2)=0 /*Even*/,Ceiling(number-1),Ceiling(number)) )
Parse_PathParse_Path(filespec,section)Retrieves the specified <1>section</1> of a <2>path</2>. Valid sections are Drive,Folder,Filename,Filename_Only (Filename without extension), Path (Full path without the filename) and Extension_Only.string
pathsectionif(section="DRIVE", If(Left(path,2)="\\", /*then*/ "\\"+LSplit(path,30,"\",3)+"\\"+LSplit(path,30,"\",4), /*else*/ LSplit(path,30,"\",1)), if(section="FOLDER", /*then*/ RSplit(path,30,"\",2), if(section="PATH", /*then*/ RSplit(path,2,"\",2), if(section="FILENAME", /*then*/ RSplit(path,2,"\",1), if(section="FILENAME_ONLY", /*then*/ LSplit(RSplit(path,2,"\",1),2,".",1), if(section="EXTENSION_ONLY", /*then*/ LSplit(RSplit(path,2,"\",1),2,".",2), "***UNKNOWN ARGUMENT FOR SECTION"))))))
PiPi()Returns the value of Pi to 8 decimal placesnumeric
3.14159265
Qtr_AdvancedQtr_Advanced(date,q1_start)Returns the quarter (1-4) of a <1>date</1>, based on a <2>different starting date for Quarter 1</2>. For example, if the date specified for the start of Q1 was 1st October 2006, then 31st January 2007 would be 2. Note that you must specify a full date for the start of Q1, but the year part is not significant, the function will work over all years for the input date.date
dateq1_startQtr(if(month(q1_start)=2,DateAdjust(date,0,-1,0), if(month(q1_start)=3,DateAdjust(date,0,-2,0), if(month(q1_start)=4,DateAdjust(date,0,-3,0), if(month(q1_start)=5,DateAdjust(date,0,-4,0), if(month(q1_start)=6,DateAdjust(date,0,-5,0), if(month(q1_start)=7,DateAdjust(date,0,-6,0), if(month(q1_start)=8,DateAdjust(date,0,-7,0), if(month(q1_start)=9,DateAdjust(date,0,-8,0), if(month(q1_start)=10,DateAdjust(date,0,-9,0), if(month(q1_start)=11,DateAdjust(date,0,-10,0), if(month(q1_start)=12,DateAdjust(date,0,-11,0),date))))))))))))
Replace_XLReplace_XL(old_text,start_num,num_chars,new_text)Replaces part of an <1>existing text string</1> with a <4>new text string</4>, using a <3>specified number of characters</3>, starting at a <2>specified position</2>. This is an Excel function name for the intrinsic function Stuff. Note there is an existing intrinsic function called Replace. See also Substitute.string
old_textstart_numnum_charsnew_textStuff(old_text,start_num,num_chars,new_text)
Search_XLSearch_XL(find_text,within_text,start_num)Returns the number of the character at which a specific <1>character or text string</1> is first found, reading left to right (not case sensitive). This is an Excel function using the intrinsic functions Instr and Substr.string
find_textwithin_textstart_numInstr(find_text,(Substr([within_text],start_num,254)))
Sign_XLSign_XL(number)Returns the sign of a number: 1 if the number is positive, zero if the number is zero, or -1 if the number is negative. his is an Excel function using the intrinsic function If.numeric
numberIf(number=0,0, If(number>0,1,-1 ))
Start_Of_Current_MonthStart_Of_Current_Month([input_date])Returns the date of the first day of the month for an optional specified <1>date</1>. If no date is specified, the date is assumed to be todays date.date
input_date(input_date+1)-Day(input_date)
(Date()+1)-Day(Date())
Start_Of_Working_WeekStart_Of_Working_Week(date)Returns the date of the first day of this working week, assuming Monday is the start of the week. If no input date is specified, the date is assumed to be todays date.date
Date()-Weekday(Date(),2)+1
dateDate-Weekday(Date,2)+1
Substitute_XLSubstitute_XL(text,old_text,new_text)Replaces <2>existing text</2> with <3>new text</3> in a <1>text string</1>. This is an Excel function name for the intrinsic function Replace.string
textold_textnew_textReplace(text,old_text,new_text)
TomorrowTomorrow()Returns tomorrow's date.date
Date()+1
Trunc_XLTrunc_XL(number)Truncates a <1>number</1> by removing the decimal, or fractional, part of the number. This is an Excel function name for the intrinsic function Int.numericconversion
numberInt(number)
Unix_Time_Number_To_DateUnix_Time_Number_To_Date(unix_time) This converts a <1>Unix or Epoch time number</1> based on UTC to a date/time. Note that Date/Time is only accurate to the second. Unix time numbers with fractions of a second will be rounded.dateconversion
unix_time{1970-01-01 00:00:00}-(unix_time/86400)
Value_XLValue_XL(text)Converts a <1>text</1> string that represents a number to a number. This is an Excel function name for the intrinsic function Val.numericconversion
textVal(text)
Weekday_Is_In_Partial_WeekWeekday_Is_In_Partial_Week(weekday, startday, endday) Returns 1 if the given <1>weekday</1> (1=Sunday, 2=Monday, etc.) is in the partial week that extends from the given <2>startday</2> up to but not including the following <3>endday</3>. Returns 0 otherwise.
weekdaystartdayenddayIf (startday <= endday, If (weekday >= startday .And. weekday < endday, 1, 0), If (weekday >= startday .Or. weekday < endday, 1, 0) )
WeekdayName_EngWeekdayName_Eng(date)Returns the English name of the day for a specified <1>date</1>.date
dateif(weekday(date)=1,"Sunday", if(weekday(date)=2,"Monday", if(weekday(date)=3,"Tuesday", if(weekday(date)=4,"Wednesday", if(weekday(date)=5,"Thursday", if(weekday(date)=6,"Friday", if(weekday(date)=7,"Saturday","*INVALID WEEKDAY*")))))))
Working_DaysWorking_Days(startdate,enddate) Returns the number of working days in the range of dates from <1>startdate</1> to <2>enddate</2>. This calculation takes into account holidays that fall on dates that what would otherwise be normal working days. Before using this function, you MUST customize the following user defined functions, starting with _WorkingDays_ : ComputeDaysOffInRange, IsWorkingDay, FirstValidDateForWorkingDays and LastValidDateForWorkingDays.date
startdateenddate/* NOTE: The meaning of the range of dates specified by 'startdate' and 'enddate' is open to debate. Some might assume that the endpoints are both included, others might feel that one or the other endpoint should be excluded from the range. For that reason, you may un-comment one of the following lines, according to what interpretation you require. */ /* Uncomment the following line to interpret the range as including both 'startdate' and 'enddate'. */ _WorkingDays_ComputeWorkingDaysInRange(startdate, enddate+1) /* Uncomment the following line to interpret the range as including 'startdate' but NOT including 'enddate'. */ /* ComputeWorkingDaysInRange(startdate, enddate) */ /* Uncomment the following line to interpret the range as NOT including 'startdate' but including 'enddate'. */ /* ComputeWorkingDaysInRange(startdate+1, enddate+1) */ /* Uncomment the following line to interpret the range as NOT including either 'startdate' or 'enddate'. */ /* ComputeWorkingDaysInRange(startdate+1, enddate) */
YesterdayYesterday()Returns yesterday's date.date
Date()-1