|
一个计算个税的自定义函数
『分享』为计算个税所得税写的自定义函数,该函数有3个参数。第一个参数应纳税所得额;第二个参数可选,全年一次性奖金;第三个参数可选,选1为计算月度个人所得税,选2为计算全年一次性奖金。计算全年一次性奖金还加入了奖金小于当月收入的判断。
欢迎大家给宝贵意见。
Function IIT(ynssd As Double, Optional ycxjj As Double, Optional j As Integer)
Dim k As Double
If j = 1 Then
Select Case ynssd
Case Is <= 0
IIT = 0
Case Is <= 500
IIT = Application.Round(ynssd * 0.05, 2)
Case Is <= 2000
IIT = Application.Round(ynssd * 0.1 - 25, 2)
Case Is <= 5000
IIT = Application.Round(ynssd * 0.15 - 125, 2)
Case Is <= 20000
IIT = Application.Round(ynssd * 0.2 - 375, 2)
Case Is <= 40000
IIT = Application.Round(ynssd * 0.25 - 1375, 2)
Case Is <= 60000
IIT = Application.Round(ynssd * 0.3 - 3375, 2)
Case Is <= 80000
IIT = Application.Round(ynssd * 0.35 - 6375, 2)
Case Is <= 100000
IIT = Application.Round(ynssd * 0.4 - 10375, 2)
Case Is > 100000
IIT = Application.Round(ynssd * 0.45 - 15375, 2)
End Select
ElseIf j = 2 Then
k = ycxjj / 12
If ynssd >= 0 Then
Select Case k
Case Is <= 0
IIT = 0
Case Is <= 500
IIT = Application.Round(ycxjj * 0.05, 2)
Case Is <= 2000
IIT = Application.Round(ycxjj * 0.1 - 25, 2)
Case Is <= 5000
IIT = Application.Round(ycxjj * 0.15 - 125, 2)
Case Is <= 20000
IIT = Application.Round(ycxjj * 0.2 - 375, 2)
Case Is <= 40000
IIT = Application.Round(ycxjj * 0.25 - 1375, 2)
Case Is <= 60000
IIT = Application.Round(ycxjj * 0.3 - 3375, 2)
Case Is <= 80000
IIT = Application.Round(ycxjj * 0.35 - 6375, 2)
Case Is <= 100000
IIT = Application.Round(ycxjj * 0.4 - 10375, 2)
Case Is > 100000
IIT = Application.Round(ycxjj * 0.45 - 15375, 2)
End Select
ElseIf ynssd < 0 Then
If ycxjj + ynssd <= 0 Then
IIT = 0
Else
Select Case k
Case Is <= 0
IIT = 0
Case Is <= 500
IIT = Application.Round((ycxjj + ynssd) * 0.05, 2)
Case Is <= 2000
IIT = Application.Round((ycxjj + ynssd) * 0.1 - 25, 2)
Case Is <= 5000
IIT = Application.Round((ycxjj + ynssd) * 0.15 - 125, 2)
Case Is <= 20000
IIT = Application.Round((ycxjj + ynssd) * 0.2 - 375, 2)
Case Is <= 40000
IIT = Application.Round((ycxjj + ynssd) * 0.25 - 1375, 2)
Case Is <= 60000
IIT = Application.Round((ycxjj + ynssd) * 0.3 - 3375, 2)
Case Is <= 80000
IIT = Application.Round((ycxjj + ynssd) * 0.35 - 6375, 2)
Case Is <= 100000
IIT = Application.Round((ycxjj + ynssd) * 0.4 - 10375, 2)
Case Is > 100000
IIT = Application.Round((ycxjj + ynssd) * 0.45 - 15375, 2)
End Select
End If
End If
End If
End Function |
|