The new Google Sheets includes the DELTA
function, which
Compare[s] two numeric values, returning 1 if they're equal.
How does this differ from the EQ
? From what I can tell, the EQ
function returns TRUE
or FALSE
, while the DELTA
function returns 1 or 0. The DELTA
function also has the option to only take one argument, which is compared against 0, but those seem like minor differences.
Are there any other differences between these functions? At first I thought DELTA
was a fuzzy comparison function that compared two values within a given tolerance, but that doesn't seem to be the case.
Best Answer
The name and concept of this function comes from Kronecker delta, and it is used for the same reason as it's used in mathematics and engineering: to include equality conditions into algebraic expressions. Excel had this function for a while; the old version of Google Sheets did not, which was noticed. So, if nothing else, better compatibility with Excel is a reason enough to add this function.
As an example, it can be used for things like "the number of places where the numbers in columns A and B agree":
Of course there are other ways to do the same, like
countif
: the point ofdelta
is that one could have it in a complex algebraic expression.The above doesn't quite work with
eq
: the formula=sum(arrayformula(eq(A1:A,B1:B)))
throws an error. One can get around it with=sum(arrayformula(1*eq(A1:A,B1:B)))
by converting boolean to integer.