Forum Discussion
mj786
Oct 26, 2025Copper Contributor
Excel conditional formula
Hi i have a problem understanding this I want to color highlight numbers from row 2 that is row 1 + 5 I mean if any number from row 2 + 5 equal to any number in row 1 to be formatted and fill...
Lorenzo
Oct 30, 2025Silver Contributor
[1, "wxyz", true, 3].map(x => +x + 5) // => [6, Nan, 6, 8]
[1, "wxyz", true, 3].map(x => Number(x) + 5) // => [6, Nan, 6, 8]
[1, "wxyz", true, 3].map((x: number) => x + 5) // => [6, "wxyz5", 6, 8]
[1, 0/0, true, 3].map((x: number) => x + 5) // => [6, Nan, 6, 8]
- SergeiBaklanOct 31, 2025Diamond Contributor
At least in Excel environment it shall be
[1, "wxyz", true, 3].map((x: number) => x + 5) // => [6, wxyz5, 6, 8]Yes, editor reports a problem "type string is not assignable to type number" if we use something like
const abc: number = "abc"but actually it works
console.log(abc + 2, ~~abc + 2) // => abc2, 2On the other hand yes, above is not a good practice which better to avoid.
Just in case, whatever to number conversion table is here javascript - parseInt vs unary plus, when to use which? - Stack Overflow