DELTA function
Tests whether two numbers are equal: returns 1 if they are, 0 if not. Also called the Kronecker delta.
Available in Excel 2007 and later (Excel 2003 needed the Analysis ToolPak add-in), Microsoft 365, Excel for the web, Excel for Mac
Excel 2007 and laterWorks in Google Sheets
Syntax
DELTA(number1, [number2])| Argument | What it means | |
|---|---|---|
number1 | Required | The first number. |
number2 | Optional | The second number. If omitted, Excel uses 0. |
Returns: 1 if the two numbers are equal, otherwise 0.
How DELTA works
DELTA is the spreadsheet version of the Kronecker delta from mathematics: it gives 1 when two numbers match and 0 when they do not. Because the answer is a number rather than TRUE/FALSE, you can add a column of DELTA results to count matches, or multiply by it to switch a value on or off.
With only one argument, DELTA checks whether the number equals 0. It only compares numbers — text, even a number stored as text, returns #VALUE!. The comparison is exact, so a value like 0.1+0.2 that is 0.30000000000000004 internally does not equal 0.3; round first if your numbers come from calculations.
In modern Excel, =--(A2=B2) or =IF(A2=B2,1,0) do the same job and also work with text; DELTA remains useful when you want an explicit, readable test or are following a formula from an engineering text.
Examples
1Are two values equal?
| A | B | C | |
|---|---|---|---|
| 1 | Planned | Actual | |
| 2 | 5 | 5 | 1 |
Result: 1
5 equals 5, so DELTA returns 1. With an actual of 4 it would return 0.
2Count exact hits
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Target | Shot | Hit? | ||
| 2 | 10 | 10 | 1 | 2 | |
| 3 | 10 | 8 | 0 | ||
| 4 | 10 | 10 | 1 |
Result: 2
Each DELTA adds 1 for an exact hit and 0 for a miss. Rows 2 and 4 match, so the total is 2. Column C shows the per-row results you would get by filling =DELTA(A2,B2) down.
3Check for zero with one argument
| A | B | |
|---|---|---|
| 1 | Balance | |
| 2 | 0 | 1 |
Result: 1
When number2 is left out, DELTA compares with 0. The balance is 0, so the result is 1.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | An argument is text — including numbers stored as text. | Convert with VALUE or use =--(A2=B2), which accepts text as well. |
Tips
- Floating-point results can differ in the 15th digit; use
=DELTA(ROUND(A2,2), ROUND(B2,2))for money. =SUMPRODUCT(--(A2:A10=B2:B10))counts matches over a whole range in one formula.
Google Sheets
DELTA also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
DELTA in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.