PRICE and YIELD

Topics: Developer Forum, Project Management Forum, User Forum
May 15, 2012 at 4:56 AM
Good news....
Existing price function is not work for basis=3 or ACT/365
you should need to change ur function:
       
$dsc_Yf=0;
       if($basis==3){
        if(($dsc+$a)>182.5){$dsc_Yf=($dsc+$a)-182.5;}else{$dsc_Yf=-(182.5-($dsc+$a));}
        }
       
        $dsc=$dsc-$dsc_Yf;
   
        $baseYF    = 1.0 + ($yield / $frequency);
        $rfp    = 100 * ($rate / $frequency);
        $de    = $dsc / $e;

        $result = $redemption / pow($baseYF, (--$n + $de));
       
        for($k = 0; $k <= $n; ++$k) {
            $result += $rfp / (pow($baseYF, ($k + $de)));
        }
       
        $result -= $rfp * (1-$de);
I also solved Yield function
Regards,

Hosain

Coordinator
May 15, 2012 at 6:36 AM

If you could provide a couple of examples of test data demonstrating this fix to the PRICE function, it would be appreciated. Similarly, if you have the code for the YIELD function, as that's a function that I haven't yet implemented in PHPEXcel.

Jun 17, 2012 at 4:28 AM

hi , can you prove me with the yield solution

Dec 2, 2012 at 12:16 PM

Dear Hosainkuet

Do you have the code for the YIELD function please?

Would be great to get that included.

thx so much

Martin