Excel formula to add numbers stored as text

对着背影说爱祢 提交于 2020-06-27 16:28:10

问题


My NodeJS program populates an excel formula in a cell which in turn calculates the sum of all the numbers in a column. The numbers are stored as text in the cells. The formula used is : =SUM(0+(I5:I19999)).

All the numbers are present in column 'I' but not necessarily till 19999th row (few may be blank).

However, the result of this formula is always #VALUE!. I can't seem to find the issue in this. Any help in this issue is really appreciated. Thanks!


回答1:


Formula you are using to add numbers stored as text i.e. =SUM(0+(I5:I19999)) is an array formula and needs to be committed by pressing Ctrl+Shift+Enter.

If you want non-array formula you can use

=SUMPRODUCT((I5:I19999)*1)



回答2:


the value in the cell must be stored as a number because sum works on numbers only if you give text then it will display #VALUE.

you can store value as numbers using numformat('0.00').you can get more info from this page https://support.office.com/en-us/article/Number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68.if you are reading then you have to convert it.

Could you please let me know which package(exceljs,Node-xlsx) are you using so that i can send you the code require?



来源:https://stackoverflow.com/questions/46400276/excel-formula-to-add-numbers-stored-as-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!