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.
A | B | C | D | E | |
1 | value | step | formula | result | description |
2 | 5 | 4 | =gestep(A2,B2) | 1 | The step value 4 is LT the value 5. |
3 | 10 | 10 | =gestep(A3,B3) | 1 | The step value 10 is LTE the value 10. |
4 | 5 | 6 | =gestep(A4,B4) | 0 | The step value 6 is GT the value 5. |
5 | 10 | =gestep(A5) =gestep(A5,B5) | 1 | If the step value is blank it would be treated as 0. | |
6 | -10 | -15 | =gestep(A6,B6) | 1 | |
7 | 25/05/2020 | 20/05/2020 | =gestep(A7,B7) | 1 |
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.
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.
=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!