Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 3801|回复: 4

[已解决]个税所得税宏问题

[复制链接]
发表于 2011-10-12 16:40 | 显示全部楼层 |阅读模式
本帖最后由 月光不合 于 2011-12-31 20:22 编辑

'计算个人收入调节税 (Individual Income Adjustment Tax)
Function iiatax(x, y)
Dim basicnum As Integer
Dim downnum As Variant, upnum As Variant, ratenum As Variant, deductnum As Variant
If y = 0 Then
basicnum = 2000 '定义中国公民个税起征点
ElseIf y = 1 Then
basicnum = 4800 '定义外国公民个税起征点
Else: basicnum = Null
End If
downnum = Array(0, 500, 2000, 5000, 20000, 40000, 60000, 80000, 100000) '定义累进区间下限
upnum = Array(500, 2000, 5000, 20000, 40000, 60000, 80000, 100000, 100000000) '定义累进区间上限
ratenum = Array(0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45) '定义累进税率
deductnum = Array(0, 25, 125, 375, 1375, 3375, 6375, 10375, 15375) '定义累进速算扣除数
If IsNumeric(x) = False Then
MsgBox ("请检查计税工资是否为数值!")
End If
If x < 0 Then
MsgBox ("计税工资为负,重新输入!")
End If
If x >= 0 And x < basicnum Then
iiatax = 0
End If
For i = 0 To UBound(downnum)
If x - basicnum > downnum(i) And x - basicnum <= upnum(i) Then
iiatax = Round((x - basicnum) * ratenum(i) - deductnum(i), 2)
End If
Next i
End Function

此宏是2000起征点的个税,请高手将宏改成3500起征点的,谢谢!
最佳答案
2011-10-18 14:27
'计算个人收入调节税 (Individual Income Adjustment Tax)
Function iiatax(x, y)
Dim basicnum As Integer
Dim downnum As Variant, upnum As Variant, ratenum As Variant, deductnum As Variant
If y = 0 Then
basicnum = 3500 '定义中国公民个税起征点
ElseIf y = 1 Then
basicnum = 4800 '定义外国公民个税起征点
Else: basicnum = Null
End If
downnum = Array(0, 1500, 4500, 9000, 35000,55000, 80000) '定义累进区间下限
upnum = Array(1500, 4500,9000, 35000, 55000, 80000, 10000000000) '定义累进区间上限
ratenum = Array(0.03, 0.1, 0.2, 0.25, 0.3, 0.35, 0.45) '定义累进税率
deductnum = Array(0, 105, 555, 1005, 2755, 5505, 13505) '定义累进速算扣除数
If IsNumeric(x) = False Then
MsgBox ("请检查计税工资是否为数值!")
End If
If x < 0 Then
MsgBox ("计税工资为负,重新输入!")
End If
If x >= 0 And x < basicnum Then
iiatax = 0
End If
For i = 0 To UBound(downnum)
If x - basicnum > downnum(i) And x - basicnum <= upnum(i) Then
iiatax = Round((x - basicnum) * ratenum(i) - deductnum(i), 2)
End If
Next i
End Function
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2011-10-13 10:15 | 显示全部楼层
回复

使用道具 举报

发表于 2011-10-18 14:27 | 显示全部楼层    本楼为最佳答案   
'计算个人收入调节税 (Individual Income Adjustment Tax)
Function iiatax(x, y)
Dim basicnum As Integer
Dim downnum As Variant, upnum As Variant, ratenum As Variant, deductnum As Variant
If y = 0 Then
basicnum = 3500 '定义中国公民个税起征点
ElseIf y = 1 Then
basicnum = 4800 '定义外国公民个税起征点
Else: basicnum = Null
End If
downnum = Array(0, 1500, 4500, 9000, 35000,55000, 80000) '定义累进区间下限
upnum = Array(1500, 4500,9000, 35000, 55000, 80000, 10000000000) '定义累进区间上限
ratenum = Array(0.03, 0.1, 0.2, 0.25, 0.3, 0.35, 0.45) '定义累进税率
deductnum = Array(0, 105, 555, 1005, 2755, 5505, 13505) '定义累进速算扣除数
If IsNumeric(x) = False Then
MsgBox ("请检查计税工资是否为数值!")
End If
If x < 0 Then
MsgBox ("计税工资为负,重新输入!")
End If
If x >= 0 And x < basicnum Then
iiatax = 0
End If
For i = 0 To UBound(downnum)
If x - basicnum > downnum(i) And x - basicnum <= upnum(i) Then
iiatax = Round((x - basicnum) * ratenum(i) - deductnum(i), 2)
End If
Next i
End Function
回复

使用道具 举报

发表于 2011-10-18 14:41 | 显示全部楼层
本帖最后由 wayy 于 2011-10-18 14:41 编辑

学习楼上的.
其实使用公式比代码应该简单一些.
回复

使用道具 举报

 楼主| 发表于 2011-10-19 23:55 | 显示全部楼层
谢谢宝宝熊老师!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-28 14:39 , Processed in 0.153237 second(s), 9 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表