formula

Gets or sets the formula of the cells.

Parameters

formula String optional

The new formula of the cell. The string may optionally start with =.

Returns

String the formula of the top-left cell of the range.

Example

    <div id="spreadsheet"></div>
    <script type="text/javascript" charset="utf-8">

        $("#spreadsheet").kendoSpreadsheet();

        var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");

        var sheet = spreadsheet.activeSheet();

        sheet.range("A1").input("1000");
        sheet.range("A2").formula("A1*2");
        /* The result can be observed in the DevTools(F12) console of the browser. */
        console.log(sheet.range("A2").formula()); // "A1*2"
    </script>

In this article