Yarns with similar stitches/inch can generally be interchanged effectively provided the yarn texture is relatively comparable. Interchanging yarns between weight group is generally not effective.
NOTE: ALWAYS ROUND UP! Being short of yarn to finish a project is very painful.
Formula for determining yardage needed for interchanged yarns...
Qty of skeins of suggested yarn x Yards per skein of suggested yarn=Total yards needed for project
Total yards needed for project/Yards per skein of substitute yarn=Qty of skeins of substituted yarn