View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
owen.cxy owen.cxy is offline
external usenet poster
 
Posts: 11
Default Pension contribution


Hi, the code below makes sense. However how do i input in as an excel formula
for each cell relative to the person? I only know how to start a formula with
an "=" sign infront of a function e.g. =SUM. How do i input these into a cell?

"Joel" wrote:

I think your descriptions are wrong. See if the UDF code below makes sense

Function contribution(Age, Wage)

contribution = 0
If Wage 50 Then
Select Case Age
Case Is <= 35
contribution = 0.05 * (Wage - 50)
Case 35 To 50
contribution = 0.02 * (Wage - 50)
Case Is 50
contribution = 0.01 * (Wage - 50)
End Select
End If

If Wage 500 Then

Select Case Age
Case Is <= 35
contribution = contribution + (0.1 * (Wage - 500))
Case 35 To 50
contribution = contribution + (0.05 * (Wage - 500))
Case Is 50
contribution = contribution + (0.02 * (Wage - 500))
End Select
End If

End Function


"owen.cxy" wrote:

Hi, Im using MS Excel 2007 and nothing else. I have a (column C of each
individuals age) and a (column J of each individuals wage). How do I
calculate the contribution of each individual based on their age and salary?

Below are the criterias.

A) Age: 35 years and below
1) Wage: less than or equal to $50 *Contribution = $0
2) Wage: more than $50 but less than $500 * Contribution = 5% of the
difference between (the individuals wage and $50)
3) Wage: more than $500 * Contribution = 10% of the individuals wage up to
the first $500 + 10% of the individuals additional wage.
E.g. If the wage is $800, Contribution = 0.1*500 + 0.1*300($800-$500)

B) Age: (Above 35 years) to (50 years and below)
1) Wage: less than or equal to $50 *Contribution = $0
2) Wage: more than $50 but less than $500 * Contribution = 2% of the
difference between (the individuals wage and $50)
3) Wage: more than $500 * Contribution = 5% of the individuals wage up to
the first $500 + 5% of the individuals additional wage.
E.g. If the wage is $800, Contribution = 0.02*500 + 0.05*300($800-$500)

C) Age: Above 50 years
1) Wage: less than or equal to $50 *Contribution = $0
2) Wage: more than $50 but less than $500 * Contribution = 1% of the
difference between (the individuals wage and $50)
3) Wage: more than $500 * Contribution = 2% of the individuals wage up to
the first $500 + 2% of the individuals additional wage.

Please help me..Thank you so much