How to Use the GESTEP Function in Google Sheets

The GESTEP function in Google Sheets is categorized under the Engineering function. It returns 1 or 0 depending on whether the value (number or date) is greater than a step (threshold) value.

For example, column A in your sheet contains a list of numbers. You want to test whether those numbers are greater than a threshold value (or threshold values) or not. Then this engineering function will come in use for you.

Another example is the target dates of tasks and actual dates of the tasks completed. In this scenario also we can use the GESTEP function to test whether the completion dates are within the target dates.

Actually, without using the GESTEP function, we can solve the above-mentioned problems in Google Sheets.

Some times using an IF logical operator or just the comparison operator >= (GTE) will do the trick for us.

You May Like: Comparison Operators in Google Sheets and Equivalent Functions.

After the syntax and arguments, you will get some GESTEP formula examples where I have used the function with or without the ArrayFormula function.

GESTEP Function in Google Sheets – Syntax and Arguments

Syntax:

GESTEP(value,[step])

Arguments:

value – The value (number or date) to test against a step value (a threshold value).

step – The step (threshold) value. It’s 0 by default. That means skipping the use of this argument would result in considering the ‘step’ value as 0.

Note:

The function returns 1 (one) if value is >= step; otherwise it returns 0 (zero).

I have already explained the purpose of the GESTEP function in Google Sheets above. Now let me explain the function with the help of some formulas.

GESTEP Formula Examples

Go through the below table for some basic examples. The ‘values’ are in column A and ‘step’ values are in column B.

The formulas are in column C and the result and description in adjoining columns will help you grasp the basic use.

ABCDE
1valuestepformularesultdescription
254=gestep(A2,B2)1The step value 4 is LT the value 5.
31010=gestep(A3,B3)1The step value 10 is LTE the value 10.
456=gestep(A4,B4)0The step value 6 is GT the value 5.
510=gestep(A5)
=gestep(A5,B5)
1If the step value is blank it would be treated as 0.
6-10-15=gestep(A6,B6)1
725/05/202020/05/2020=gestep(A7,B7)1
Legend: LT – Less than, GT – Greater than, LTE – Less than or equal to

Actually, if there are multiple ‘values’ and multiple ‘step values’ as per the above table, then we can make use of an ArrayFormula in cell C2.

=ArrayFormula(gestep(A2:A7,B2:B7))

Don’t forget to empty the range C3:C7 for the array formula to expand the outputs.

This array formula brings new possibilities to the use of the GESTEP function in Google Sheets. How?

With the array formula, we can check whether numbers or dates in a list is greater than or equal to a single step value (threshold value). How?

Here I am going to use the above array formula. The values to check are from the range A2:A6 but the step value is # 5.

The following formula would check whether values in the said range are GTE to the step value 5.

=ArrayFormula(gestep(A2:A7,5))

Formula Alternatives – IF Logical and (Comparison) Operators

Other than using the comparison operators, as far as I am concerned, there are no formula alternatives to the GESTEP function in Google Sheets.

See the ‘original’ formulas in in column D and the alternative formulas in column F, H, and J.

GESTEP Function and Alternatives in Google Sheets

Needless to say, all the formulas in the above example can be replaced by array formulas too. I am skipping that part.

GESTEP Formula within Filter Function in Google Sheets

I am going to conclude this post with this Filter example.

I have a few tasks in column A and the target dates to complete those tasks are in column B. In column C you can see the actual completion dates of the tasks (please refer to the screenshot below).

How to filter only the tasks that completed within the target completion dates?

The below Filter and GESTEP combination formula does that.

Check whether tasks are completed in time
=filter(A2:A18,gestep(B2:B18,C2:C18))

Notes:

  • The GESTEP function in Google Sheets would return #VALUE! error if the step value (both or either of the arguments) is a string. So in the example, the Filter function automatically skips the rows containing strings in column C.
  • The actual completion date in column C should not be left blank as it would be treated as 0.

For your info, in cell B2, actually I’ve used the below formula to get the bimonthly dates.

=filter(
     sequence(250,1,date(2020,1,1),1),
     (day(sequence(250,1,date(2020,1,1),1))=16)+
     (day(sequence(250,1,date(2020,1,1),1))=1)
)

That’s all about how to use the GESTEP function in Google Sheets. Enjoy!

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.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

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.