Problem with equations in extrusions

Hello i have a problem with equations. 

What i want to achieve is the following:
I have a part with a ladder type of frame, the height of the steps is a variable, but theres also a hole in the part that has a permanent depth. I want to extrude it until it the hole is completely extruded, the frame can sometimes be lower or higher than the depth of the hole. So i want that it extrudes until it has either reached the end of the hole or the end of the first step. After that it extrudes whats left with or without the hole. 

This is what i have. 
variable: B
Functions:  (first step) IIF ( 1 + "B" - 5.5 < 0 , 1 + "B" , 5.5 )
                  (second step) IIF ( "B" + 1 - 5.5 < 0 , 5.5 - "B" - 1 , 0 )


The problem i am having is with the second function. Whenever it is bigger than 0 it should return no extrusion or (0). Instead i get the following error: "The equations evaluates to a value that lies outside the modeler resolution."

Is there someone that has another way to achieve the same or how to fix this? 

Thanks in advance,
Mauro

Edu CAD