HomeGoogle DocsSpreadsheetHow to Use the Delta Function in Google Sheets

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.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

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.