Avatar of Scott Fell
Scott Fell
Flag for United States of America asked on

Export excel sheet with usable formulas

Is it possible to export an excel file created on the fly to include formulas?

I already know about adding the header with  application/vnd.ms-excel or just exporting as a csv.  Is there a way to have a formula exported that allows the user to change data in the sheet and auto sum via a formula?

The server side language in this case would be php.
Microsoft ExcelWeb DevelopmentPHP

Avatar of undefined
Last Comment
Mark Brady

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Mark Brady

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mark Brady

Hey did you get a chance to try my code sample?
Scott Fell

ASKER
Thank you Mark.

I just saw your answer.   It looks like you are referring to https://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-worksheet.writeformula.php

Reading through that library does not seem promising because bugs go back to 2009 that are still open. https://pear.php.net/package/Spreadsheet_Excel_Writer/download

 I don't have this installed.  Are you currently using this?  On windows or Linux?
Scott Fell

ASKER
If  a library is required, perhaps php excel is the way to go?


https://phpexcel.codeplex.com/
https://github.com/PHPOffice/PHPExcel/blob/1.8/Examples/03formulas.php
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Mark Brady

I have only ever used the native php library to do excel functions including saving formulas. If you want to look at alternatives I would take a look at this one. It seems to do what you want.

http://www.phpclasses.org/package/6235-PHP-Parse-and-access-binary-Excel-files-in-pure-PHP.html