If column A contains a date Less than the beginning of the Financial Year
divide column C by Number of days of the month then multiply in column B
and If column A contains a date between the beginning and end of the financial year
divide column D by Number of days of the month then multiply in column B
Code: Select all
Function Sanctions(dtm, dys, totals1, totals2)
Dim sab As Long
Dim md As Long
Dim totals As Double
sab = Year(DateAdd("m", 6, dtm))
If sab = 2021 Then
totals = totals1
Else
totals = totals2
End If
md = Day(DateSerial(Year(dtm), Month(dtm) + 1, 0))
Sanctions = totals / md * dys
End Function
in column N .... The rest will be deducted in the coming months Until the amount to be deducted is over.
It would be appreciated if someone could kindly assist me in add some conditions to follow up on this ...Thank you in advance