Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel formula in PHP

Tags:

php

excel

Can anyone tell me the math behind this MS Excel functions. I am writing code in php and I am unable to use Excel to calculate these but I still need the same result.

CUMIPMT(rate,nper,pv,start_period,end_period,type) Returns the cumulative
interest paid on a loan between start_period and end_period.

My Excel Function -

=IF($C$33<0,CUMIPMT($C$36/12,$C$35,-$C$33,$C$34,$C$34+11,0),-CUMIPMT($C$36/12,$C$35,$C$33,$C$34,$C$34+11,0))

One more question - I used (=E11-E12) but it is not substracting, it adds both values, i cant understand why?

Thank you in advance

like image 553
Xi Kam Avatar asked Oct 22 '22 13:10

Xi Kam


1 Answers

I haven't used it, but you may want to check out the PHPExcel Library. Excel and PHP are different enough that you will either need to use a library like the one I linked to or write functions to do all of that math manually. In your case, it seems like handling excel files may be the easiest way to accomplish your goal.

like image 144
Brendon Dugan Avatar answered Oct 27 '22 10:10

Brendon Dugan