**GTW** returns the time in hours when a variable meets a condition.
__SYNTAX:__

**GTW(VarNum,GroupOffset/StartDate,Grouping/EndDate, Condition, Limit, Type) **

**VarNum:** The variable number to get the total for.

**GroupOffset/StartDate:** Used with the Grouping parameter to set the dates to calculate the stat for. Sets the number of Groups (set by the Grouping Parameter) to be added to set the dates. See examples below. If this field is a date string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the start date to calculate the stat for.

**Grouping/EndDate:** Used to set which dates to calculate the stat for. If the Grouping is a date literal string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the end date to calculate the stat for. Common Groupings are:

"D" Days

“M” Monthly

"R" Report Dates

Click here for available Grouping options

**Condition:** Valid Settings are: "<", "=", ">"

**Limit:** Value to compare value to.

**Type:** What value is returned. Set to "Max" or "Sum" GTW can return the Maximum Time ("Max") the value met the condition or the total time ("Sum") the variable met the condition.

__EXAMPLES:__

**=GTW(2,3,"D",">",2,"MAX") **- return the maximum time that variable 2 for day 3 of the report is greater than 2.

NOTE: Cells in green show which hours meet the condition. Notice, that on 5/1/2021 it is considered on as the value prior to 5/1/2021 was greater than 2.

1. The value at the start of the day is greater than 2 and it stayed above 2 all day. Therefore the Max time and Total time is 24.

2. The value at the start of the day is greater than 2, and then meet condition from 06:00 thru 13:00 so total is 9 and max time is 8 (i.e. 6AM thru 1PM is 8 hours).

3. The value at the start of the day is less than 2. Met condition from 1AM to 2AM, at 8AM, and from 12 (noon) thru 6PM for a Max time of 7 and a total of 10.