public void Formula1()
{
GcSpreadGrid gcSpread1 = new GcSpreadGrid();
gcSpread1[0, 0].Value = 1;
gcSpread1[0, 1].Value = 2;
gcSpread1[1, 0].Value = 3;
gcSpread1[1, 1].Value = 4;
object result1 = gcSpread1.Evaluate("(1+2)/3");
object result2 = gcSpread1.Evaluate("SUM(A1:A2)-AVERAGE(B1:B2)");
object result3 = gcSpread1.Evaluate("SUM(R[-2]C[-2]:R[-1]C[-1])", 2, 2, null, ReferenceStyle.R1C1);
// The value of result1, result2 and result3 are:
// 1
// -0.5
// 10
}
Public Sub Formula1()
Dim gcSpread1 As New GcSpreadGrid()
gcSpread1(0, 0).Value = 1
gcSpread1(0, 1).Value = 2
gcSpread1(1, 0).Value = 3
gcSpread1(1, 1).Value = 4
Dim result1 As Object = gcSpread1.Evaluate("(1+2)/3")
Dim result2 As Object = gcSpread1.Evaluate("SUM(A1:A2)-AVERAGE(B1:B2)")
Dim result3 As Object = gcSpread1.Evaluate("SUM(R[-2]C[-2]:R[-1]C[-1])", 2, 2, Nothing, ReferenceStyle.R1C1)
' The value of result1, result2 and result3 are:
' 1
' -0.5
' 10
End Sub