Hacker News new | ask | show | jobs
by asuffield 4297 days ago
I was particularly impressed by this detail further down the conversation:

Let A1 = 1, A2 = blank, A3 = 3

PRODUCT(A1:A3) is 1

A1 * A2 * A3 is 0

2 comments

Well that's just inconsistent and annoying and wrong.

I think the original comments are still over the top, as it seems to be arguin that a defined convention exists but the OP disagreed with it.

However if your example is what they were actually complaining about then hell yes.

Within Excel, ranges ignore blank cells in computation, but a reference to a blank cell returns 0. The idea being that if you specify a cell in a computation, you're expecting something to be there, whereas when you have a range, you may have sparse data throughout that range, and therefore, the result shouldn't break.

SQL behaves similarly. See: http://www.sqlfiddle.com/#!15/37025/5

> Let A1 = 1, A2 = blank, A3 = 3

> PRODUCT(A1:A3) is 1

3, I think (based on experimentation).