Casio FC-200 Financial Consultant
|
12-27-2020, 05:49 AM
Post: #13
|
|||
|
|||
RE: Casio FC-200 Financial Consultant
(12-26-2020 11:31 PM)Albert Chan Wrote: return D-E-E - sign(D-7*E + W - 6) If end date falls on Saturday, and start date not on Sunday, sign correction mess goes away. Example, networkdays between 1/1/2021 (Friday) to 4/1/2021 (Thursday) Remove the correction term by adjusting end-date to Saturday, 4/3/2022 Sat D = 31 + 28 + 31 + 2 = 92 days E = floor(D/7) = 13 weeks networkdays (1/1/2020 to 4/3/2020) = D-E-E = 66 networkdays (1/1/2020 to 4/1/2020) = 66 - 1 = 65 PHP Code: function networkdays(A, B) -- assumed date A <= B |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)