#!/usr/local/bin/perl # Ages 70 to 85 @let = (16,15.3,14.6,13.9,13.2,12.5,11.9,11.2,10.6,10.0,9.5,8.9,8.4,7.9,7.4,6.9, 6.5,6.1,5.7,5.3,5.0,4.7,4.4,4.1,3.9,3.7,3.4,3.0,2.8,2.7,2.5,2.3,2.1,1.9, 1.8,1.6,1.4,1.3,1.1,1.0); $args = $ENV{'QUERY_STRING'}; print "Content-type: text/html\n\n"; if (length($args) < 3) { print <IRA/401(k)/403(b) Calculation
Farmers State Bank Farmer State Bank
Your North Iowa Community Bank
 | HOURS & LOCATIONS | HOME | 
Deposit Services Agricultural Banking Lending Services
Real Estate Lending
Other Banking Services
Electronic Banking Services
About FSB
Community, Fun & Information
Contact FSB

IRA/401(k)/403(b) Retirement Calculation

Beginning Balance of Account
Monthly Contribution
Current Age
Years Until Retirement
Estimated Annual Pre-retirement Yield (%)
Estimated Annual Retirement Yield (%)
Estimated Annual Inflation (%)
Estimated Annual Contribution Increase(%)
Desired Future Monthly Withdrawal Amount (current dollars)

 

FDIC Privacy Statement | Terms and Conditions

Copyright © 2002 Farmers State Bank
Equal Housing Lender
FullForm } else { print "Future Estimations\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Farmers State BankFarmer State Bank
Your North Iowa Community Bank
\n"; print "
 | HOURS & LOCATIONS | HOME | 
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Deposit ServicesAgricultural BankingLending Services
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Real Estate  Lending
Other   Banking Services
Electronic Banking Services
About FSB
Community, Fun   & Information
Contact FSB
\n"; print "
\n"; print "\n"; print "\n"; print "
\n"; print "

Future Estimations

\n"; # Let's do the calculations! @va = split("&",$args); for ($i=0; $i<9; $i++) { @va[$i] = substr(@va[$i],5); } ($abal,$pymt,$age,$time,$intr,$ryld,$infl,$raiz,$wdrw) = @va; print "Inputs\n"; print "
Beginning Balance of Account \$ $abal\n"; print "
Initial monthly contribution \$ $pymt\n"; print "
Current Age $age years\n"; print "
Time until retirement $time years\n"; print "
Estimated annual yield (before ret.) $intr % \n"; print "
Estimated annual yield (during ret.) $ryld % \n"; print "
Estimated annual inflation $infl % \n"; print "
Estimated annual contribution increase $raiz % \n"; print "
Desired monthly withdrawal \$ $wdrw (current dollars)\n"; print "



\n"; $intr = $intr/1200; $raiz = $raiz/100; $infl = $infl/100; $adj = 1; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; for ($i=0; $i<$time; $i++) { $c_age = $age + $i + 1; for ($j=0; $j<12; $j++) { $abal = $abal * (1 + $intr) + $pymt; } $pymt = $pymt * (1 + $raiz); $adj = $adj/(1 + $infl); $pbal = $abal * $adj; printf("
YearAgeMonthly
Contrib
Actual
Balance
Current Dollar
Balance
%2d %2d \$ %9.2f \$ %11.2f \$ %11.2f\n", $i+1,$c_age,$pymt,$abal,$pbal); } $awdr = $wdrw/$adj; print "

At this time:

\n"; $pen = 1; if ($c_age < 60) { print "Hey, you aren't 59 1/2 yet!"; print "You'll have to take a 10% hit on your withdrawals"; $pen = 1.10; } printf("
  • Your last monthly contribution was : \$ %9.2f\n",$pymt); printf("
  • Your current required withdrawal is : \$ %9.2f\n",$awdr); print "

    Let's start taking money out and see how long it lasts\n"; if ($ryld > 8) { print <WARNING!That is a high yield to maintain during retirement

    Your specified annual yield of $ryld % may not be feasible if you regularly expect to withdraw funds from your account. These typically represent stock or more volatile bond funds which are quite unpredictable. You should consider estimated a lower yield once you are retirimg and withdrawing funds.

    HighRateWarning } $intr = $ryld/1200; print "\n"; $obal = $abal; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; while($abal > 0 && $yr < 110) { $yr++; $annw = 0; $note = " "; for ($j=0; $j<12; $j++) { if ($abal * (1 + $intr) > $awdr) { $abal = $abal * (1 + $intr) - $awdr; $annw = $annw + $awdr; } else { $annw = $annw + $abal; $abal = 0; $j = 12; } } if (($c_age + $yr) >= 70 && @let[$c_age + $yr - 70] > 0) { $w_min = $abal / @let[$c_age + $yr - 70]; if ($annw < $w_min) { $abal = $abal + $annw; $annw = $w_min; $abal = $abal - $annw; $note = "Minimum Withdrawal Limit *"; } } if (($c_age + $yr) < 60) { $abal = $abal - $annw * .1 ; $note = sprintf("Early W/D Tax: \$ %6d",$annw * .1); } $adj = $adj/(1 + $infl); $pbal = $abal * $adj; printf("
    YearAgeBalanceCurrent Dollar
    Balance
    Annual
    Withdrawal
    Note
    %2d %2d \$ %9.2f \$ %9.2f \$ %9.2f %-20s\n", $yr, $c_age +$yr , $abal, $pbal, $annw, $note); $awdr = $awdr * (1 + $infl); if ($c_age + $yr > 70 && $abal > ($obal * (1 + $infl))) { print "

    Congratulations! You are set for life!

    \n"; print "Your balance is earning more than you are taking out\n"; $abal = 0; } $obal = $abal } print "
  • \n"; print "
    Another Calculation?
    \n"; print "
    * = Note that with the Minimum Withdrawal Limit, even though you must withdraw the funds from your IRA it doesn't mean you must spend it! Put the surplus into a money market or bond fund and it will probably add quite a few years to your withdrawal period.\n"; print "
    \n"; print "
     
    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
    FDICPrivacy Statement | Terms and Conditions

    Copyright © 2002 Farmers State Bank
    Equal Housing Lender
    \n"; print "\n"; print "\n"; print "\n"; }