December 2, 201114 yr Hello all, I need to divide the span of an opening until the span is less than a given value, each time subtracting the width of the divider. This is somewhat similar to building a wall and putting in 2x4s until the largest gap is no larger than x. Unlike a wall though, the value isn't based on the center of the 2x4 but on the span between them. The given parameters and example values are: span = from 0" to 200" maxGap = 24" dividerWidth = 4" So the span (200") will have one divider (4") inserted, leaving two even gaps of 98" each. One more divider will be added incrementally until the evenly sized gaps between dividers is less than the maxGap (24") Thanks for your help!
December 2, 201114 yr Recursion is not necessary. Number fields: Span, maxGap, and dividerWidth. Calculation fields: Divisions = If(not IsEmpty(span) and not IsEmpty(maxGap) and not IsEmpty(dividerWidth); Ceiling(span/(maxGap+dividerWidth));"") DividerCount = Divisions - 1 Gap = (span - (dividerWidth*dividerCount))/Divisions
December 2, 201114 yr Author Wow! Thank you very much doughemi. That's a very complete, concise and comprehensive answer. And just what I needed.
Create an account or sign in to comment