How to calculate two colums for subtracting

Posted by: cvetx on 8 September 2017, 1:50 pm EST

  • Posted 8 September 2017, 1:50 pm EST

    What is the function name to get a value from two colums for subtracting?


    Thanks.

  • Replied 8 September 2017, 1:50 pm EST

    Hello Cvetex, 

    You may either use

    FpSpread1.ActiveSheet.Cell(RowIndex,ColIndex).value

    or

    FpSpread1.ActiveSheet.GetValue(RowIndex,ColIndex)

    to get the value of any cell. 

    Regards, 

     

  • Replied 8 September 2017, 1:50 pm EST

    I geuss I was not specific to ask things.


    My goal is set a value on 10th column that is calculated from 8th and 9th colum  when a spread sheet is loaded with data. This is about "Formula ". like this. (mycell.Formula = "SUM(A1:A2) * 2")


    This the way what I want to do.  I am waondering about how to get a value for 10th column with formula.


    8th column   9th column   10th column


    10                      7                   3
    20                      6                   14
    4                        1                    3


     Thanks.


     


     


     

  • Replied 8 September 2017, 1:50 pm EST

    If you want to set the Formula at column level, you may use the ColumnName followed by 1st row index to refer cell by reference. For example. to set the formula on 10th column that uses the values of 8th and 9th Column, you may use following code: 

            FpSpread1.ActiveSheet.Columns(10).Formula = "(I1 + J1)*2"

    the above code will set the formula for all the rows of 10th column using the respective rows of 9th and 8th Column

    Regards, 

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels