# What is the difference between the DELTA and EQ functions?

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.

## 1 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":

``````=sum(arrayformula(delta(A1:A,B1:B)))
``````

Of course there are other ways to do the same, like `countif`: the point of `delta` 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.

• Ah, so part of the problem with `EQ` (or maybe with Google Sheets, Excel, etc.) and thus the use case for `DELTA` is that they don't necessarily cast booleans to integers at all times? – Michael A Jan 11 '16 at 15:41