VBA code for Income Tax

ACCA

New member
Joined
Feb 7, 2017
Messages
23
Reaction score
0
Points
1
Excel Version(s)
excel 2007
I need VBA Codes for custom function (income tax) with following conditions:


Income tax=(S2-S1) * X
Where
S2 = Income at higher level
S2=income at lower level
X= Tax rate

If S1> 60000
and S2<1200000
THEN
Income tax=(S2-S1) * 0.05

IF S1>1,200,000
and S2<1,800,000

THEN
Income tax=(S2-S1) * 0.10+30000

IF S1>1800000
and S2<2500000
THEN
Income tax=(S2-S1) * 0.15+90000

IF S1>2500000
and S2<3500000
THEN
Income tax=(S2-S1) * 0.175+195000
 
Last edited:
Something like this perhaps...

Code:
Public Function IncomeTax( _    ByVal S2 As Variant, _
    ByVal S1 As Variant _
    ) As Double
    
    If IsNumeric(S2) And IsNumeric(S1) Then


        If S1 > 60000 And S2 < 1200000 Then
            IncomeTax = (S2 - S1) * 0.05
        ElseIf S1 > 1200000 And S2 < 1800000 Then
            IncomeTax = (S2 - S1) * 0.1 + 30000
        ElseIf S1 > 1800000 And S2 < 2500000 Then
            IncomeTax = (S2 - S1) * 0.15 + 90000
        ElseIf S1 > 2500000 And S2 < 3500000 Then
            IncomeTax = (S2 - S1) * 0.175 + 195000
        Else
            IncomeTax = 0
        End If
        
    End If
    
End Function
 
Thank you for your clarification. I hope this helps me in calculating my taxes. I will try to use your way to speed up the calculation process and not spend a lot of money on it. If you know how to make a fake check stub, then you understand how easy it is to calculate the amount of taxes paid and how much net income you will have with this method. Every time I use this app, I am surprised at how much tax we pay every year, especially after calculating the year's total amount. It is the actual theft. I wish the situation in the world would settle down, and taxes would go down.
 
Last edited:
Back
Top