Excel: why the value of a blank cell is zero?

房东的猫 提交于 2021-02-15 06:21:17

问题


Suppose there is an empty excel sheet. Enter formula "=A1" into the B1 cell. The value of B1 would be 0.

My question is: why the value of B1 becomes zero when referring to an empty cell A1? Any rationales Excel behaves this way?

Thanks.


回答1:


That is because the formula in B1 returns the value of cell A1.

Excel assigns the value 0 to a blank cell.

To distinguish 0 from blank, in B1 enter:

=IF(A1="","",A1)



回答2:


FWIW, force a zero-length string with =A1&"". This can also be used to show (an apparently blank) cell when a VLOOKUP of INDEX/MATCH wants to return a zero after encountering a blank cell to return. Two caveats: first, a zero-length string is not truly blank and second, if used with VLOOKUP(...)&"" then any true number that should have been returned as a true number becomes text-that-looks-like-a-number. – Jeeped

Quoting the best answer so I can vote on it :)

I changed my application to =formula&"" according to Jeeped, and works great. Kinda dumb that Index returns Value(formula).



来源:https://stackoverflow.com/questions/43191270/excel-why-the-value-of-a-blank-cell-is-zero

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