H
Henry
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 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
==============================
microsoft.public.excel.misc,microsoft.public.excel.newusers,microsoft.public postedDon Guillett said:Thanks for the thanks and the explanation.
the
delete button to kill off etc
ever since. Soooooooolineto
all. It's only when don't
then see what othersupin
Harlan's signature:-in federal
income