â!&"Call Date & TimeD@-see "PriceRules" workbook task.*-it is more readableD@You can change these variables:ÒÎ-it is sometimes more natural and easier to use macros instead of formulas to implement business rules†‚-this sample shows how to use macros to implement business rules&"Night time ends:"Standard rate:&"Night time rate: Weekend rate:*&Night time starts:JF-it is easier to code and maintainNJPhone Calls Price Calculation Sample<8Table with phone calls dataNJ-all bussiness logic is in one placeDuration Price€|"Price" column is calculated using workbook task "PriceRules" Arial yHÿÿEÔCPriceRules>'--------- Load Variables rowNumber=Row(ActiveCell()) callTime=CellRef(1,rowNumber) duration=CellRef(2,rowNumber) standardRate=b10 nighttimeRate=b11 weekendRate=b12 nighttimeStart=b13 nighttimeEnd=b14 '--------- Rules isWeekend= Or(Weekday(callTime)=6,Weekday(callTime)=1) nighttime= And(Hour(callTime)>=nighttimeStart,Hour(callTime)<=nighttimeEnd) if isWeekend callRate=weekendRate elsif nighttime callRate=nighttimeRate else callRate=standardRate end price=duration*callRate Set(CellRef(3,rowNumber),price)§ÿõ  SetPricesnfor i=20 to 35 Sel(CellRef(1,i)) PriceRules endSheet1 O7ÈÿGArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿOÈÿ¼GArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿOÈÿGArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿOÈÿ¼GArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿOÈÿ¼GArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿOÈÿGArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿO7Èÿ¼GArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿO7ÈÿG"ArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿO7Èÿ¼G"ArialK ìßF˜±Ð±@±±P±ú«ÅGÿÿ ÿ - - K - K  K - K %-%d.M.yyd-MMM-yyd-MMMMMM-yyh:mm tt H:mmh:mm:ss ttH:mm:ssd.M.yyH:mm þ] À À  À   À  À  À  À  À  À   À @ À  H À @ @ À  H À @€@ @ À  À @  À  @À @ À  À @€@  À   À @€  À  @À @€ @@ "À  €À @€@"@ "À €À @€" @ "À A€À @€ "&À À &@ @ À  I€À @ @ À  HÀ @ !À  À ! À  À  À  À   Z&è?'è?(ð?)ð?*,d# þ û ¯ ÿ€  ÿ ÿ ÿ ÿ ÿ ÿ ÿ  ÿ ×£p= ·?  ÿ{®Gáz¤?  ÿ ¸…ëQ¸®?  ÿ ì?  ÿ Ð? ÿ  ÿ $ÿ   0ÿ «ªªª-àâ@ @ ×£p= ç? 0ÿ ?àâ@9@@ 0ÿ rÇqDàâ@@Ház®GÑ? 0ÿ Jàâ@@)\Âõ(ä? 0ÿ ƒ-Ø‚Tàâ@ @ ×£p= ç? 0ÿ ú¤Oú~àâ@;@p= ×£p@ 0ÿ (}Ò'‚àâ@@@¸…ëQ¸þ? -ÿ ÍÌÌÌ‹àâ@ð?¸…ëQ¸®? -ÿ ïîîî­àâ@A@{®Gáz@ -ÿ [°¼àâ@@ ×£p= ×? 0ÿ JŸôIÏàâ@@ ×£p= Ç? -ÿ DDDDÒàâ@@¸…ëQ¸¾? -ÿ DDDDáâ@ð? ×£p= ·? - ÿ Ø‚-Øáâ@ð? ×£p= ·? -!ÿ Ò'}Òáâ@7@Âõ(\@ -"ÿ ä8Žã!áâ@ €B@ ¤p= ×£ @ +ÿ ,ÿ -ÿ .ÿ /ÿ 0ÿ 1ÿ 2ÿ 6ÿ€ ë