The +
operator in Excel gives an error when adding two cells whose values are empty text, while the SUM
function treats these cells as zero (as I expected). I am trying to understand if this is the intended operation for the +
operation or a bug I need to report. If it is the intended operation for the +
operator, what is the advantage of or reason for this difference?
To reproduce, I have a spreadsheet with =""
in cells C1 and D1. Cell A1 has the formula =C1+D1
, while cell B1 has the formula =SUM(C1,D1)
. The spreadsheet is otherwise empty. The result is a #VALUE!
error in cell A1, and 0
in cell B1. My expectation was that both would be 0.
I am using Excel for Mac 16.84 (24041420) from an Office 365 subscription running on macOS Sonoma 14.4.1.
SUM()
function ignoresText
values and will give you the sum of numeric values only, and hence why it returns0
while using+
operator it returns error because there are non-numeric text values and thus returns an error.+
operator and your data may probably be a text you can useN
function as number filter to avoid errors.=N(C1)+N(D1)
.N
converts any values (except errors) to zero if they are not numbers. However, if you have text-formatted numbers, then if you simply add them=C1+D1
, they will be added as numbers, while bothSUM
andN
will treat them as0
.