6 Replies Latest reply on Dec 19, 2014 7:29 AM by Matthew Peterson

    Excel-like equation

    Matthew Peterson

      Good morning,

       

      I can't seem to get a field to calculate like I would in Excel.

       

      I want the first cell to simply be equal the column to its left and each cell below to equal one cell divided by the sum of that cell and another cell.

       

      For example, G is the column I'm trying to calculate and the following are the numbers in G that I WANT but I'm not getting:

       

      A          B          C          D          E          F          G
      0%       145       436       145       436       75%      75%

      1%       130       178       275       614       58%      69%

      2%       57         67        332        681       54%      67%

      .          .            .           .            .           .            .

      .          .            .           .            .           .            .

      .          .            .           .            .           .            .

      100%  648       457       3732       2471      41%      40%

       

      So, I want G at 0% to be equal to F at 0%.  After that, I want G in any row to be equal to E#/sum(D#:E#) but when I use any equation I can think of like the following I'm either getting an error or I'm getting the exact same numbers I have in the F-column:

       

       

      if attr([A]) = 0 then [F]

      elseif attr([A]) > 0 then (E/(E+D)

      end

       

      Thanks!

      Matt