By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

Insert an equation in a CSV cell

code green
Expert 100+
P: 1,726
Is it possible to write a literal equation to a csv file.
Something like =D2/E2*100 so that Excel calculates and displays the result?
Feb 11 '08 #1
Share this Question
Share on Google+
3 Replies


code green
Expert 100+
P: 1,726
Yes of course you can
[PHP]$equation = '=D'.$row.'/E'.$row.'*100';[/PHP] or variations thereof.
Thanks for looking.
Feb 11 '08 #2

Markus
Expert 5K+
P: 6,050
Yes of course you can
[PHP]$equation = '=D'.$row.'/E'.$row.'*100';[/PHP] or variations thereof.
Thanks for looking.
You're welcome.
Post back anytime you require my assistance again!
Feb 11 '08 #3

code green
Expert 100+
P: 1,726
Ok, what about this one, inserting a function in a CSV cell
[PHP]$equation = '=ROUND(('.chr($column+$key).$row.'-D'.$row.')/'.
chr($column+$key).$row.'*100'.",".'1)'[/PHP] The comma in the Excel ROUND function is stripped out.
I would not have been suprised to see the '1' pushed to the adjacent cell,
but it simply disapears.
So I end up with
Expand|Select|Wrap|Line Numbers
  1. =ROUND((G2-D2)/G2*1001)
Any idea how to keep the comma there?
Feb 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.