GcSpread.Sheets Namespace > Cell type : formula Method |
var instance = new GcSpread.Sheets.Cell(sheet, row, col, sheetArea); var returnValue; // Type: string returnValue = instance.formula(value);
function formula( value : string ) : string;
activeSheet.setValue(0,0,1); activeSheet.setValue(0,1,2); activeSheet.setValue(0,2,10); activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); var formula = activeSheet.getFormula(1,1); alert(formula);
activeSheet.setValue(0, 0, 'abc');
activeSheet.setValue(1, 0, 'ac');
activeSheet.setValue(2, 0, 'a*');
activeSheet.getCell(0, 1).formula('COUNTIF(A1:A3,"a*")'); //start with a
activeSheet.getCell(1, 1).formula('COUNTIF(A1:A3,"a?")'); //"a" and only one other character
activeSheet.getCell(2, 1).formula('COUNTIF(A1:A3,"a~*")'); // should be "a*"
activeSheet.getCell(0,2).formula("DATEDIF(DATE(2003,1,1),DATE(2016,1,1),\"Y\")");