Compute Tax?

  • Thread starter Thread starter FeDude
  • Start date Start date
FeDude,

I'm not familiar with US Tax laws but I think that if you earn over $311,950
you still pay tax on the first $311,950. Your program:
Case Else '0 or more than 312000
federalTax = 0

would imply that you pay no tax at all.

Try:

Public Function federalTax(income As Integer) As Integer
Select Case income
Case Is <= 14000
tax = income * 0.1
Case 1400.01 To 56800
tax = 14000 * 0.1 + (income - 14000) * 0.15
Case 56800.01 To 114650
tax = 14000 * 0.1 + (56800 - 14000) * 0.15 + (income - 56800) * 0.25
Case 114650.01 To 174700
tax = 14000 * 0.1 + (56800 - 14000) * 0.15 + (114650 - 56800) * 0.25 +
(income - 114650) * 0.28
Case 174700.01 To 311950
tax = 14000 * 0.1 + (56800 - 14000) * 0.15 + (114650 - 56800) * 0.25 +
(174700 - 114650) * 0.28 + (income - 174700) * 0.33
Case Is > 311950
tax = 14000 * 0.1 + (56800 - 14000) * 0.15 + (114650 - 56800) * 0.25 +
(174700 - 114650) * 0.28 + (311950 - 174700) * 0.33
Case Else 'You should never get here!
'0 income is covered by the first case statement 0 * 0.15 = 0
'Even Bill Gates is covered by the Case Is > 311950 statement!!!
MsgBox ("An error has occurred in the program")
End Select
End Function

HTH
Henry
I'm starting to think that using standard formulas looks pretty involved and
probably unmaintailable in the long run..

I wanted to try my hand at VB so I took this opportunity to get my feet wet,
thinking a custom function was the way to go. However, I added this
function to my worksheet, but I can't seem to call it from a cell in the
worksheet. I'm guessing I've done something wrong in either the function or
where I put it in the worksheet, but I don't know.

Any help here would be appreciated.


================================
Public Function federalTax(income As Integer) As Integer

' 2003 Tax Table
'Income But Pay This Plus Of the
'Is Over Not Over Amount This % Excess Over
' 0 14,000 0 10% 0
' 14,000 56,800 1,400 15% 14,000
' 56,800 114,650 7,820 25% 56,800
'114,650 174,700 22,283 28% 114,650
'174,700 311,950 39,097 33% 174,700


Select Case (income)
Case 0 To 13999 '10%
federalTax = 0 + income * 0.1
Case 14000 To 56799 '15%
federalTax = 1400 + ((income - 14000) * 0.15)
Case 56800 To 114649 '25%
federalTax = 7820 + ((income - 56800) * 0.25)
Case 114650 To 174699 '28%
federalTax = 22283 + ((income - 114650) * 0.28)
Case 174700 To 311949 '33%
federalTax = 39097 + ((income - 174700) * 0.33)
Case Else '0 or more than 312000
federalTax = 0
End Select

End Function
==============================

Don Guillett said:
Thanks for the thanks and the explanation.

the
delete button to kill off etc
ever since. Soooooooo
microsoft.public.excel.misc,microsoft.public.excel.newusers,microsoft.public posted
to
all. It's only when don't
then see what others
line
in
Harlan's signature:-
up
in federal
income
 
Why not just go to the IRS web site and look up any amount of income in the
Tax Tables or Tax Rates.

Tax Student in Training
 
If you define two Arrays such that

TaxBrkts TaxPrcts
0
0.1

6000
0.05

27950
0.12

67700
0.03

141250
0.05

307050
0.035



Which were taken directly from the tax table some past period, and assuming
taxable incone is in cell A39,

Use the formula =SUMPRODUCT((A39>TaxBrkts)*(((A39-TaxBrkts)*TaxPrcts))) and
enter it as an array formula
the correct tax can be calculated.

Dan
 
Don,

<<You might have noticed an earlier post to this question.>>

For whatever reason, I didn't.

There was a while where the posts were coming in very slowly on my network.

But I can assure you Don that if I had seen the plethora of posts prior to
mine, I would not have written what I did.

Regards,
Kevin
 
Back
Top