VintaSoft Imaging .NET SDK 12.4: Documentation for Web developer
In This Topic
    XLSX: Work with formulas on XLSX page
    In This Topic
    WebSpreadsheetEditorControlJS control allows to work (view, add, edit and delete) with formulas in cells of XLSX worksheet in web browser.

    Formulas can be changed manually using mouse/keyboard or programmatically.


    Add a formula to the focused cell of XLSX worksheet

    If you want to add a formula to the focused cell of XLSX worksheet using mouse, you should do the following steps:

    Here is JavaScript code that demonstrates how to add a formula to the focused cell of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    
    var formula = "ABS(A1)+SUM(B2,B3)";
    // add formula to the focused cell
    spreadsheetEditorControl.insertFormulaInFocusedCell(formula);
    // result formula value: "=ABS(A1)+SUM(B2,B3)"
    
    


    Change formula of focused cell programmatically

    Here is JavaScript code that demonstrates how to change a formula of focused cell of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get the spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    
    // get value or formula of focused cell
    var cellValue = spreadsheetEditorControl.get_FocusedCellValue();
    
    // set value or formula of focused cell
    spreadsheetEditorControl.set_FocusedCellValue("0");
    
    


    Edit the formula of the focused cell using mouse and keyboard

    You can edit the formula of the focused cell using textbox in formula panel (external editor) or using textbox in cell region (internal editor).

    If you want to create the formula that references another cell, you should do the following steps:

    If you want to create the formula that uses values from several cells, you should do the following steps:

    If you want to see cells, which are used in the formula, you should do the following steps:


    Delete the formula of focused cell of XLSX worksheet

    If you want to delete the formula of focused cell of XLSX worksheet using mouse, you should do the following steps:

    Here is JavaScript code that demonstrates how to delete the formula of the focused cell of XLSX worksheet:
    // _spreadsheetDocumentEditorControl is an instance of WebSpreadsheetDocumentEditorControlJS class
    
    // get spreadsheet editor
    var spreadsheetEditorControl = _spreadsheetDocumentEditorControl.get_SpreadsheetEditorControl();
    
    // clear contents (value and formula) of selected cells
    spreadsheetEditorControl.clearCellsContent();
    
    


    List of supported formulas


    Here is the list of supported "Date and Time" formulas:
    Here is the list of supported "Engineering" formulas:
    Here is the list of supported "Financial" formulas:
    Here is the list of supported "Information" formulas:
    Here is the list of supported "Logical" formulas:
    Here is the list of supported "Lookup and Reference" formulas:
    Here is the list of supported "Math and Trigonometry" formulas:
    Here is the list of supported "Statistical" formulas:
    Here is the list of supported "Text and Data" formulas: