Define what is equal
Decide whether the spaces, center distances, or edge margins need to be equal. Those are not the same layout.
Subtract occupied width
When objects have width, subtract the combined object width before dividing the remaining space.
Count spaces correctly
Five objects have four spaces between them. If equal end margins are included, the same five objects create six spaces.
Mark from one end
Use the calculated positions from one reference edge instead of stepping the spacing across the work.

The calculator is one part of the job
Use the result to support a decision, then compare it with the drawing, material, tool, product instructions, and actual conditions.