BestTechie Forums: Vb Macro In Excel - BestTechie Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Vb Macro In Excel If, then, Else problem


#1 User is offline   mikex 

  • Cajun Geek
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1572
  • Joined: 25-August 04
  • Location:70549
  • Operating System:XP Pro

Posted 10 May 2007 - 11:21 AM

I want to put the problem below in an excel sheet. I figure this is more along the lines of programing.....

S = Salary per period. this will vary but the period total will be listed in cell G16
X = Number of personal exemptions claimed for withholding; X may be 0, 1, or 2. this will be 2
Y = Number of dependency credits claimed for withholding; Y may be 0 or greater. this will be 2
M = Income Brackets for tax rate change.

If X = 0 or 1, then M1 = $12,500, and M2 = $25,000
If X = 2, then M1 = $25,000, and M2 = $50,000
N = Number of pay-periods per year (for example, weekly = 52 or monthly =12). this will be 52



W = Withholding tax.
S = Salary per period. 
X = Number of personal exemptions claimed for withholding; X may be 0, 1, or 2.
Y = Number of dependency credits claimed for withholding; Y may be 0 or greater.
M = Income Brackets for tax rate change.

If X = 0 or 1, then M1 = $12,500, and M2 = $25,000
If X = 2, then M1 = $25,000, and M2 = $50,000
N = Number of pay-periods per year (for example, weekly = 52 or monthly =12).

If S > 0
Then A = (S * .021)
Else A = 0

If S > (M1 / N)
Then B = .0135 [S - (M1 / N)]
Else B = 0

If S > (M2 / N)
Then C = .0135 [S - (M2 / N)]
Else C = 0

D = .021 {[(X * $4,500) + (Y * $1,000)] / N}

If [(X * $4,500) + (Y * $1,000)] > M1
Then E = .0135 {[(X * $4,500) + (Y * $1,000) - M1] / N}

If (A + B + C) - (D + E) > 0
Then W = (A + B + C) - (D + E)
Else W = 0


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users