[英]Result formula from excel and javascript is different
我有總penumpang的excel公式
=SUM(D1:D2)-SUM(A3:C3)+C4 and have result 29 when i tried input specific value
然后我嘗試了 javascript
document.getElementById('totalpnp4').value = parseInt(d1)+parseInt(d2)-parseInt(a3)+parseInt(b3)+parseInt(c3)+parseInt(C4); and have result 34 when i tried input same value at excel
那么,如何使 javascript 具有與 excel 函數相同的結果值? 謝謝
使用括號對值進行分組:
document.getElementById('totalpnp4').value = (parseInt(d1)+parseInt(d2))-(parseInt(a3)+parseInt(b3)+parseInt(c3))+parseInt(C4);
求和 a3+b3+c3,然后從之前的總和中減去它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.