Insert an equation in a CSV cell

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    Insert an equation in a CSV cell

    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?
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Yes of course you can
    [PHP]$equation = '=D'.$row.'/E'.$row.'*100';[/PHP] or variations thereof.
    Thanks for looking.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by code green
      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!

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        Ok, what about this one, inserting a function in a CSV cell
        [PHP]$equation = '=ROUND(('.chr( $column+$key).$ row.'-D'.$row.')/'.
        chr($column+$ke y).$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
        Code:
        =ROUND((G2-D2)/G2*1001)
        Any idea how to keep the comma there?

        Comment

        Working...