Formula Pro 7: Excel Formula Engine for JavaScript

Formula Pro 7 is the Excel formula engine of Jspreadsheet v13, in the browser and in Node.js. The syntax is modern Excel: spill ranges, unions, 3D references, and functions you can pass as values and call in place. Argument validation follows Excel too.

icon jspreadsheet

Published on September 26, 2026

Introducing

Formula Pro parses and runs spreadsheet formulas in the browser or in Node.js. It uses a shunting yard parser and no eval. Version 7 brings the function count to 525 and adds the syntax of modern Excel: dynamic arrays that spill, lambdas that can be passed and called, and references that span areas and worksheets.

Formula Pro 7 requires Jspreadsheet v13. If you are on v12, stay on Formula Pro 6; v11 pairs with Formula Pro 5.

Formula Pro 7, the Excel formula engine of Jspreadsheet v13

New in Formula Pro 7

New references

The reference syntax now matches Excel. A spill operator reads the whole output of a dynamic array. Unions combine areas, and intersections keep the cells two references share. 3D references span every worksheet between two endpoints. Trim references drop the blank rows and columns around a range.

Syntax Meaning
=SUM(A1#) The spill range of the formula anchored at A1
=SUM((A1:B2,D6)) A union of areas, counted twice where they overlap
=A1:B5 B3:C6 The intersection of two references
=SUM(Sheet1:Sheet3!A1) Every worksheet between the two endpoints, in tab order
=SUM(A1.:.E10) The range without its leading and trailing blanks, as TRIMRANGE

Functions as values

A bare function name can be passed where a lambda is expected, and a function returned by an expression can be called in place. Lambdas capture their scope.

=BYROW(A1:B2,SUM)
=LAMBDA(X,LAMBDA(Y,X+Y))(1)(2)
=CHOOSE(2,LAMBDA(1),LAMBDA(X,X*3))(5)

Functions added

No function was removed, and these were added:

  • Dynamic arrays: TAKE, VSTACK, TOCOL, TOROW, WRAPROWS, WRAPCOLS, TRIMRANGE, GROUPBY, PIVOTBY, IMAGE
  • Text: REGEXTEST and the byte functions FINDB, LEFTB, LENB, MIDB, REPLACEB, RIGHTB, SEARCHB, plus ASC, BAHTTEXT, DBCS, JIS, PHONETIC
  • Financial: VDB, ACCRINTM, DURATION, MDURATION, RECEIVED, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD
  • Statistical: the FORECAST.ETS family
  • Web: WEBSERVICE and FILTERXML, resolved through the cell cache so the cell shows the value when the request completes
  • Math and logic: REDUCE, PERCENTOF
  • Compatibility: PERCENTRANK, WEIBULL

Excel fidelity

Every function now declares the number of arguments it accepts, and a wrong count returns #N/A. When several arguments are invalid, the first one in argument order decides the error. Empty and omitted arguments are told apart, and the 32767-character text limit applies per function. An invalid value inside a computed array fails only its own cells, not the whole formula.

Some functions changed behavior to match desktop Excel. COUNT skips error values, and so do AGGREGATE and SUBTOTAL in their counting modes. MAX, MIN, MAXA and MINA ignore booleans and numeric text in referenced cells. REGEXEXTRACT and REGEXREPLACE use the Excel signature. The full list is in the documentation.

Engine API

  • formula.locale drives locale-aware date parsing and the byte semantics of the DBCS functions, and Jspreadsheet sets it from the worksheet configuration.
  • formula.loopError is the #LOOP! error instance returned on circular references, and formula.errors.blocked the #BLOCKED! error of IMAGE.
  • formulas.json lists every function with its description, syntax, parameters, examples and category, ready for an insert function dialog or an AI assistant. It ships in the jspreadsheet package, under dist/.
  • The TypeScript definitions cover the object-form call, the scope custom functions receive, and the configuration properties.
  • formula.debug is now off by default. Set it to true to log evaluation errors to the console.

Installation

npm install @jspreadsheet/formula-pro
import jspreadsheet from 'jspreadsheet';
import formula from '@jspreadsheet/formula-pro';

formula.license('###');

jspreadsheet.setExtensions({ formula });

Useful links

Formula Pro Documentation
What's New in Jspreadsheet 13
Changelog