
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@startinfinity/formulajs
Advanced tools
JavaScript implementation of most Microsoft Excel formula functions
Official website and documentation is here
Powered by jsDelivr, you can use the latest version of Formula.js:
<script src="https://cdn.jsdelivr.net/npm/jstat@1.9.2/dist/jstat.min.js"></script> 
<script src="https://cdn.jsdelivr.net/gh/formulajs/formulajs@2.9.1/dist/formula.min.js"></script>
Then the functions can be accessed as
formulajs.Date(2008, 7, 8)
formulajs.SUM([1, 2 , 3])
...
Install the package:
npm i @formulajs/formulajs
The functions DATE, DATEVALUE, EDATE, EOMONT, NOW, TODAYreturn plain JS Date instead of the serial Excel number.
Copying composite formula directly from Excel into JS will not work out of the box:
= DATE(2020,5,9) - DATE(2020,5,8) // Formula.js: 86400000 / Excel: 1
It is not recommended to use DATEVALUE to parse string representing a date. Formula.js uses new Date('YOUR STRING') under the hood. There are better libraries to do this job (for example Moment.js)
If you were previously using formulajs from Sutoiku, some functions have been removed, due to dependency simplification.
Text functions:
FIXED, TEXT, DOLLAR, VALUE
Math functions:
MDETERM, MINVERSE, MMULT, MUNIT
Otherwise the 2 packages are fully compatible. You can swap them.
The code of this package is originally forked from @handsontable/formulajs version 2.0.2 (released in January 2020). The two packages were identical at the time. There is no regression, only fixes and new functions since the fork.
This project is forked from handsontable/formula.js and it's developed for everyone needs.
Original Formula.js project was developed and maintained by Ismael Chang Ghalimi, with support from STOIC and help from the following contributors: Ilmari Karonen, Sébastien Loisel, Trevor Norris, Roönaän, Hannes Stiebitzhofer.
It was then forked and extended by the handsontable/formula.js mainly contributed by @budnix.
The road map in the coming month is to gather the improvements made in the main forks of the original project. If you forked and made changes to sutoiku/formula.js do not hesitate to propose a pull request with your changes.
To avoid any regression or miss calculation please provide unit tests as long as function improvements.
FAQs
JavaScript implementation of most Microsoft Excel formula functions
We found that @startinfinity/formulajs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.