Reply to comment
(Date d, Duration p, Date r)
Returns the last day of the period in which the date falls. The cycle of periods is defined by the given Duration p, repeated in sequence starting at the given reference date r. If the period p is not a whole number of days, the fractional part is ignored.
LastDayOfPeriod([Payment Date], [Quarter Length in Days], [Fiscal Year Start Date]) returns the last day of the quarter in which the Payment Date falls.