can I any one help me to find a formula to calculate 401K plans for my project? Thanks

Compound Interest

With compound interest, the interest due and paid at the end of the interest compounding period is added to the initial starting principal to form a new principal, and this new principal becomes the amount on which the interest for the next interest period is based. The original principal is said to be compounded, and the difference between the the final total, the compound amount, accumulated at the end of the specified interest periods, and the original amount, is called the compound interest.
In its most basic use, if P is an amount deposited into an account paying a periodic interest, then S is the final compounded amount accumulated where S = P(1+i)^n, i is the periodic interest rate in decimal form = %Int./(100m), n is the number of interest bearing periods, and m is the number of interest paying periods per year. For example, the compound amount and the compound interest on $5000.00 resulting from the accumulation of interest at 6% annual interest compounded monthly for 10 years is as follows: Since m = 12, i = .06/12 = .005. Since we are dealing with a total of 10 years with 12 interest periods per year, n = 10 x 12 = 120. From this we get S = $5000(1+.005)^120 = $5000(1.8194) = $9097. Consequently, the compound interest realized is $9097 - $5000 = $4097. Of course the compound interest can be calculated directly from the simple expression I = P[(1+i)^n - 1].

The interest associated with annuities, loans, mortgages, savings accounts, IRA's, etc. are all based on the compound interest principle. Some additional applications of the use of compound interest are offered below.

1--What will R dollars (your contribution and your copany matching contribution) deposited in a bank account at the end of each of n periods, and earning interest at I%, compounded n times per year, amount to in N years?
This is called an ordinary annuity, differeing from an annuity due. An ordinary annuity consists of a definite number of deposits made at the ENDS of equal intervals of time. An annuity due consists of a definite number of deposits made at the BEGINNING of equal intervals of time.
For an ordinary annuity over n payment periods, n deposits are made at the end of each period but interest is paid only on (n - 1) of the payments, the last deposit drawing no interest, obviously. In the annuity due, over the same n periods, interest accrues on all n payments and there is no payment made at the end of the nth period.
The formula for determining the accumulation of a series of periodic deposits, made at the end of each period, over a given time span is

S(n) = R[(1 + i)^n - 1]/i

where S(n) = the accumulation over the period of n inter, P = the periodic deposit, n = the number of interest paying periods, and i = the annual interest % divided by 100 divided by the number of interest paying periods per year. This is known as an ordinary annuity.
When an annuity is cumputed on the basis of the payments being made at the beginning of each period, an annuity due, the total accumulation is based on one more period minus the last payment. Thus, the total accumulation becomes

S(n+1) = R[(1 + i)^(n+1) - 1]/i - R = R[{(1 + i)^(n + 1) - 1}/i - 1]

Simple example: $200 deposited annually for 5 years at 12% annual interest compounded annually. Therefore, R = 200, n = 5, and i = .12.

Ordinary Annuity
..................................Deposit.......Interest.......Balance
Beginning of month 1........0................0.................0
End of month..........1.....200...............0...............200
Beg. of month.........2.......0.................0...............200
End of month..........2.....200..............24...............424
Beg. of month.........3.......0.................0................424
End of month..........3.....200............50.88..........674.88
Beg. of month.........4.......0.................0.............674.88
End of month..........4.....200............80.98..........955.86
Beg. of month.........5.......0.................0.............955.86
End of month..........5.....200...........114.70........1270.56

S = R[(1 + i)^n - 1]/i = 200[(1.12)^5 - 1]/.12 = $1270.56

Annuity Due
..................................Deposit.......Interest.......Balance
Beginning of month 1......200..............0................200
End of month..........1.......0...............24................224
Beg. of month.........2.....200..............0..................424
End of month..........2.......0.............50.88...........474.88
Beg. of month.........3.....200..............0...............674.88
End of month..........3.......0.............80.98...........755.86
Beg. of month.........4.....200..............0..............955.86
End of month..........4.......0...........114.70..........1070.56
Beg. of month.........5.....200..............0..............1270.56
End of month..........5.......0...........152.47..........1423.03

S = [R[(1 + i)^(n +1) - 1]/i - R] = 200[(1.12)^6 - 1]/.12 - 200 = $1,423.03

To calculate the value of a 401K plan, you will need to use the compound interest formula. Here's how you can use it:

1. Determine the amount of your initial deposit (P) into the 401K plan.
2. Determine the annual interest rate (i) for the plan. This is the rate at which your investment will grow.
3. Determine the number of interest compounding periods (n) for the plan. This is typically the number of years you plan to save for retirement.
4. Determine the number of interest paying periods per year (m). This is usually 12 for monthly contributions.
5. Calculate the compound amount (S) using the formula S = P(1 + i/m)^(n*m).
6. The result will give you the final accumulated amount in your 401K plan.

For example, let's say you make an initial deposit of $5,000 into your 401K plan and contribute $200 per month for 10 years with an annual interest rate of 6% compounded monthly. In this case, P = $5,000, i = 6% divided by 12 months = 0.005, n = 10 years, and m = 12 months.

Using the compound interest formula S = P(1 + i/m)^(n*m), we get:
S = $5,000(1 + 0.005)^(10*12) = $5,000(1.005)^120 = $9,097

So, after 10 years, the value of your 401K plan would be approximately $9,097.