Short answer: For two gates, break the run into three solid spans. Round bay counts inside each span, add both gate-boundary posts, then count a shared corner only once if another run uses the same physical post.
Swipe the diagram sideways to see every label. The full calculation is written below it.
Divide the run at every opening
Measure from the run start to gate 1, between gates, and from gate 2 to the end. In the adjustable 96-ft example, two 4-ft gates start at 20 ft and 60 ft, leaving 20, 36, and 32 ft of solid fence. Do not divide the combined 88 ft as though it were one continuous span.
Round bays by solid span
At an 8-ft maximum, those three spans require 3, 5, and 4 bays: 12 in total. Count each run end and both sides of each gate as separate boundary posts, then add only the interior bay posts. This example yields 15 distinct post positions. Moving a gate can change the rounded bay count while total solid length stays the same.
Reconcile the physical layout
The fence planner draws all nonoverlapping gates on a run and reports rails and pickets separately. If another run meets at a corner, count that common physical post once. Premade panels, gate hardware, bracing, post size, and local conditions need a product and site check; the arithmetic does not specify a safe gate structure.
Hypothetical worked example
Worked two-gate layout: on a 96-ft straight run, 4-ft gates span 20–24 ft and 60–64 ft. The solid spans are 20, 36, and 32 ft. At an 8-ft maximum bay, round each span separately: 3 + 5 + 4 = 12 bays. Six span-boundary posts plus nine interior bay posts yield 15 distinct posts. Gate hardware and any shared corner on another run are separate checks.
Which situation matches your project?
Limit to check: Gate frame, hinges, latch, bracing, and post design are product-specific; the material count is not a structural gate specification.
Further reading
YardSetup prepared this guide from the stated geometry and the linked references where provided. The adjustable example runs in your browser. See our formulas and limits or report an error.