How can I simplify this formula?

<<If:

MAX(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))-MIN(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))>5>>

**<<MAX(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))-MIN(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))>>**

<<EndIf>>

<<If:

MAX(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))-MIN(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))<5>>

<<MAX(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))-MIN(SELECT(Worktime[Time1], AND([_THISROW-1].[Equipment] = [Equipment], [_THISROW].[GID]=[GID])))>>

<<EndIf>>

How can I simplify this formula? It takes up a lot of space on the template.