How to Use the Delta Function in Google Sheets [Formula Examples]

Published on

The Delta function in Google Sheets is categorized under the Engineering function. This post includes the purpose, syntax, and formula (array/non-array) examples of this simple to use function in Docs Sheets.

Personally, if I want to test whether values in any two columns are equal in row-wise, I would prefer to use this function. But there are equivalents that you can find at the end of this post.

Let’s begin with the purpose of the Delta function in Google Sheets.

Purpose:

The purpose of the Delta function is pretty simple to understand. It compares two numeric values and returns 1 if they match, else 0.

Syntax:

DELTA(number1, [number2])

There are two arguments, for two numbers to test/compare for equality, in this function in Google Sheets.

If you omit the second argument (which is an optional argument) the function will compare the first number with 0 for equality.

With the help of this function, you can also compare two dates, two timestamps and also time entries.

As a side note, to compare strings or other values including date, number, time, timestamp, etc., you can use the EQ function in Google Sheets. Please do note that instead of 1 or 0, EQ returns TRUE or FALSE.

To learn EQ function and other comparison operators in Sheets please check the following guide – Comparison Operators in Google Sheets and Equivalent Functions.

Formula Examples to the Delta Function in Google Sheets

Here are a few Delta formula examples.

Compare Two Numbers and Return 1 if Match, Else Return 0:

=delta(100,100)

Result: 1

=delta(22,25)

Result: 0

Compare Two Dates and Return 1 if Match, Else Return 0:

=delta(date(2019,10,29),today())

The above formula compares the date 29/10/2019 with today’s date and will return 1 if both the dates are the same, else 0.

Please note that the Delta function treats a blank cell as the same as a zero.

Delta Formulas in Sheets

Delta in Array Use

Here is one real-life example of the use of the Delta function in Google Sheets.

I have quotations from two vendors for 10 different products as below.

Delta Function in Google Sheets in Array

Using the SUM function with Delta, we can count the number of items the vendors match their prices.

The formula for the same, which you can find in cell E3, is as below.

=ArrayFormula(SUM(delta(B3:B12,C3:C12)))

You can also use different formulas to get the above count. Here are two such formulas that immediately came to my mind.

Formula 1:

=ArrayFormula(sum(--eq(B3:B12,C3:C12)))

Formula 2:

=ArrayFormula(SUM(--(B3:B12=C3:C12)))

Similarly, you can compare dates in two columns like whether the ordered date and despatched date are the same.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

Finding Most Frequent Text in Excel with Dynamic Array Formulas

Looking to identify the most frequently occurring text in Excel? You can do this...

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.