x-spreadsheet icon indicating copy to clipboard operation
x-spreadsheet copied to clipboard

Arithmetic with strings

Open SheetJSDev opened this issue 2 years ago • 3 comments

Set cell A1 to the string "1x" (no quotes) and cell B1 to the number 2. Enter the formula =A1*B1 in cell C1.

nan

Cell C1 will have the value "2*NaN"

SheetJSDev avatar May 18 '22 05:05 SheetJSDev

1x is not number

HondryTravis avatar May 18 '22 06:05 HondryTravis

The expected result is some sort of NaN or error. Excel / Google Sheets generates a #VALUE! error. Numbers shows the error message "The operator “*” expects a number, but cell A1 contains a string.". "2*NaN" looks like a hybrid of numeric and text interpretations

SheetJSDev avatar May 18 '22 06:05 SheetJSDev

yep, will fix this

HondryTravis avatar May 18 '22 06:05 HondryTravis