Substituting yarn by weight category alone (swapping one "worsted" for another) gets you into the right general range, but it doesn't guarantee a matching result, because two yarns in the same category can still carry meaningfully different yardage for the same weight of fiber. The yards-per-weight ratio is the number that actually predicts whether a substitute will behave like the original.
The yards-per-weight ratio
Divide a yarn's length by its weight, in the same units for both the original and substitute (yards per 100g works well), and compare the two results as a ratio. A ratio close to 1.0 means the substitute is spun to roughly the same thickness as the original, even if the brands describe them with slightly different weight-category names. A ratio meaningfully above or below 1.0 signals the substitute is actually thinner or thicker than the original, regardless of what the label calls it.
Reading the ratio
A ratio between roughly 0.9 and 1.1 signals a close match, safe to substitute with normal swatch-and-check confidence. Between roughly 0.75 and 1.25, the substitute is close enough to be worth trying but different enough that a careful gauge swatch matters more than usual, and the finished project's drape or hand may shift noticeably even if the stitch count works out. Outside that range, the substitute is different enough in actual thickness that it's likely to change both gauge and the finished fabric's character, even if both yarns are marketed under the same weight-category name.
Total yardage, not just skein count
Once a substitute clears the ratio check, total yardage needed transfers directly: multiply the original pattern's total skein count by the original skein's yardage to get total yards required, then divide by the substitute's skein yardage and round up to find how many substitute skeins to buy. This calculation doesn't depend on weight category at all, only on actual yardage, which is why it stays accurate even when the two yarns' weight labels don't match cleanly.
What the ratio can't tell you
Yardage ratio measures thickness. It says nothing about fiber content, so a wool substitute for an original cotton yarn can pass the ratio check cleanly and still behave completely differently in the finished piece, wool has stretch and loft cotton doesn't, and cotton has drape and weight wool doesn't. A close yardage ratio is a strong signal the gauge will translate. It's not a guarantee the finished garment will feel or drape the way the original pattern intended.