Handsontable example

HTML

<script src="https://cdn.jsdelivr.net/npm/handsontable@9.0/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@9.0/dist/handsontable.full.min.css" /> 

<div id="example"></div>

JavaScript

const data = [
  ['a', 'aa', '=LEN(A1)', '', '', '', '', ''],
  ['aaa', 'aaaa', '=LEN(A1:B1)', '', '', '', '', ''],
  ['aaaaa', 'aaaaaa', '=LEN(A1:B2)', '', '', '', '', ''],
  ['=SUM(LEN(A1:B2))', '', '', '', '', '', '', ''],
  ['', '', '', '', '', '', '', ''],
  ['', '', '', '', '', '', '', ''],
  ['', '', '', '', '', '', '', ''],
  ['', '', '', '', '', '', '', ''],
  ['', '', '', '', '', '', '', ''],
];


const hyperformulaInstance = HyperFormula.buildEmpty();
const container = document.getElementById('example');

new Handsontable(container, {
  data: data,
  colHeaders: true,
  rowHeaders: true,
  height: 'auto',
  beforeChange(changes, source) {
  	console.log(changes, source);
  }, 
  formulas: {
    engine: hyperformulaInstance,
    sheetName: 'Sheet1'
  }
});