tags:

views:

46

answers:

2

I have an excel spreadsheet that contains some formulas to calculate ROI for an upcoming product of a client. Is it possible to convert this into a php script whereby a user would type into some boxes and then submit it working out the same. The excel spreadsheet is here: http://www.solidcamxpress.co.uk/roi.xls

+2  A: 

Sure, PHP can do math just like Excel's formulas. However, there is no magic method of converting Excel to a Web page, if that's what you're asking.

Ryan Chouinard
Would you be able to help me convert it to PHP? I can do all the HTML/CSS for the forms and grab the data. But the maths side of it is currently beyond my skill level.
Cameron
@Cameron: The math part should just be formulas that can be ported from one syntax to another. I imagine the UI is going to be the time-consuming part. If there's any given equation or expression you find that you don't understand then we can help you with that, but if you're looking to rent a coder then this isn't really the forum. Or if you don't know the syntax of the language you're porting from/to, there's only limited case-by-case help this forum is willing to offer. We can't teach you a language.
David
I've started the form here: http://www.solidcamxpress.co.uk/roi-calculator/ I will be doing all the POST stuff myself. I just don't understand how I will get all the fields to do the formulas or how to covert the formulas (I guess some of the fields will need to be set to disabled and use there default values).If you could perhaps tell me what one or two of the formulas in the spreadsheet would be in PHP then I can take a stab at it then hopefully post up the code should I get stuck. Thanks
Cameron
Using PHPExcel, mentioned in Marc's response, you can populate data cells in your existing workbook, then read the calculated values from the formula cells; although there's nothing complex in your formulae that you couldn't do simply in PHP anyway.
Mark Baker
A: 

You can use PHPExcel to read an existing spreadsheet and extract its data/formulas, but converting those formulas from Excel syntax to PHP is rather non-trivial.

Unless you're doing a generalized Excel->PHP converter, the time/effort required to write such a converter will be far greater than it would take you do analyze the one spreadsheet by hand and code up some PHP stuff to recreate it.

Marc B