Ok, now that that's out of the way....substituting yarns is another much-requested topic from my reader survey a few years ago. It's one I think about a lot, because it's rare when I use the actual yarn called for in a pattern, much less the color, and I have seen a lot of really great blog posts covering this topic in recent years (I link to my favorites at the end of this post).
Here's what I've learned over the years, mostly via trial and error:
Gauge: Correct gauge is critical, otherwise there's no way your finished piece will turn out well. While this is most important for something that needs to fit a specific way (i.e. a sweater or other garment), gauge is also important for other projects. I know that a lot of accessory patterns say that gauge is not critical, but if you have too much of a difference between the stated gauge and your own, you could end up with comically tiny (or large) finished projects that will end up in the frog or donate pile.
Last but not least, if you are substituting yarn in a sweater or garment pattern, keep in mind that your gauge swatch may lie. Even if you wash it, there's really no way to replicate the weight that a full garment has when it's completely waterlogged from a full wet block - and that can majorly distort your finished garment in a way that your swatch could never predict. In fact, I had that happen recently with a test knit in which I subbed in some yarn from my stash (the now-discontinued Louet Gems) and the sleeves grew to a length that would have better suited a gorilla. While it was wet, I was able to reshape the sweater to reduce the unexpected gain in length, but that did result in sleeves that were wider than I was planning on. And they were still a bit long (I had to fold up the cuffs). So, lesson learned.
Yarn Weight: At times, the stated weight of the yarn can seem arbitrary. I've worked with skeins that were labeled "fingering weight" which were clearly lace weight, and vice versa. The line between fingering and sport weight can be murky. DK/Aran/Worsted weight apparently mean different things to different people. At this point, I'm inclined to ignore the stated yarn weight entirely in favor of measuring it myself with one of my favorite new tools: the WPI Gauge from Nancy's Knit Knacks. All you have to do is softly wrap your yarn around the tool and count the number of wraps in the one-inch increment. Apparently, being able to turn the tool as your wrap (instead of keeping the tool static and wrapping the yarn around by hand) produces more accurate results.
Needless to say, if your yarn is mislabeled, you are in for some surprises. And even if you somehow achieved the stated gauge, your fabric is going to be a lot more dense if your yarn weight is heavier than what the design calls for, or airier if the reverse is true. Sometimes, this can be desirable; other times, a disaster!
Yardage: Especially for a design that requires multiple skeins of yarn, don't forget to compare yardage to make sure you don't run out. Simply going by weight or the number of skeins listed is a sure-fire way to lose at yarn chicken. And if you are using a hand-dyed yarn or something that comes in a limited dye lot, do yourself a favor and get a safety skein. Getting 1 more skein than you actually think you need (or maybe even 2!) is never a bad idea. Plus, if you don't break into it, you can always use it to make a matching hat or cowl, list it for sale on Ravelry, or you might even be able to exchange it for a different color at the shop where you purchased it (many dyers and yarn stores will happily exchange unused, pristine skeins of yarn, but of course you should ask about the return/exchange policy ahead of time so you are not taken by surprise!).
Yarn Color: Variegated and speckled yarns are so pretty in the skein, but they can be challenging to work with. A pattern with a complex stitch pattern that is shown in a solid or semisolid colorway was probably designed that way for a reason: the details will get lost in a more complex variegated color. Case in point, I knit this gorgeous hat with a variegated skein of yarn that I simply couldn't resist - and the stitch pattern is completely lost (if you don't believe me, click here to see the hat knit in a non-variegated colorway!).
You can learn more about yarn substitution on these blog posts: