Adding formula
See original GitHub issueHello!
After running the code below and when I open the file the cell shows =A1+B1. It seems that excel doesn’t understand that it is a formula in B1. What do I do wrong?
var Excel = require('exceljs');
exports.test = function(req, res){
var workbook = new Excel.Workbook();
var worksheet = workbook.addWorksheet("Sammanstallning");
workbook.getWorksheet("Sammanstallning");
worksheet.getCell("B1").value = '=A1+C1';
worksheet.getCell("C1").value = 0.14;
workbook.xlsx.writeFile("korrtermer/test_exceljs.xlsx");
res.end();
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Create a simple formula in Excel - Microsoft Support
You can create a simple formula to add, subtract, multiply or divide values in your worksheet. Simple formulas always start with an equal...
Read more >Overview of formulas in Excel - Microsoft Support
Create a formula that refers to values in other cells · Select a cell. · Type the equal sign =. Note: Formulas in...
Read more >How to Create a Formula in Excel Beginner Tutorial (2022)
Go to Formulas tab > Function Library > Insert function button > Type the function name. In the Insert Function dialog box, type...
Read more >Formulas and Functions in Excel (Easy Tutorial)
Enter a Formula | Edit a Formula | Operator Precedence | Copy/Paste a Formula | Insert Function. A formula is an expression which...
Read more >Add formulas & functions - Android - Google Docs Editors Help
You can use functions and formulas to automate calculations in Google Sheets. ... Tap the cell where you want to add the formula....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s because you have assigned it as a text value. To add a formula, you need to assign it like this:
Just a fix, worksheet.getCell(‘B1’).value = { formula: ‘A1+C1’, result: 0.14 }; instead worksheet.getCell(‘B1’).value = { formula ‘A1+C1’, result: 0.14 };