If you're using a pattern that calls for ABC Yarn and you're not going to use that yarn - sometimes the pattern will tell you that ABC yarn comes in 100 gr ball and has 235 yards. So if the pattern says you need 3 balls, you need 3 x 235 yds = 705 yds total. Even if the pattern doesn't tell you the yardage of the called for yarn, you can usually find it elsewhere - find the manufacturer's website or even an on-line store that sells it and they will give you the yardage.
Then you look at the yarn you are going to use - say it comes in 200 yds per ball - you'd need 4 balls.
If I'm subbing a different yarn, I would probably get 1 ball more then I thought I'd need, just to be sure I had enough (but I am nurotic that way).
Mirl56 at Ravelry, too.
Learn from the mistakes of others. You canít live long enough to make them all yourself. Eleanor Roosevelt
Lady Feb Sweater
more shawlettes, socks