Many times you love a pattern, but hate the yarn they chose. Now, we can't blame the designers for choosing an ugly yarn (often it is not their choice) or a weight that only looks good on a bulldog with a bag over its head (bulky weight yarn on anyone bigger than a twig??) So we just need to make some adjustments to the pattern to make it useable with our yarn of choice. Now go knit that swatch!
There are many tutorials for changing yarns of the same weight, which only involves looking for yarns with the same stitches per inch. The issue, however, is when you decide that a pattern would look better in a fingering weight yarn, versus the worsted weight called for in the pattern, or better in a bulky weight instead of a cobweb laceweight yarn.
My example is completely made up, with a pattern that requires worsted weight yarn, and I want to use a fingering weight. Look at your pattern. Let's say that you need a yarn in worsted weight, that gets 18 sts per 4 inches, or 4.5 stiches per inch. The yarn I have chosen is a fingering weight, so I need to knit a swatch with it to determine the how to adjust the pattern.
Let's say that I get 6 stitches per inch with my fingering weight replacement yarn. All you need to do is divide the stitches for replacement yarn by the stitch gauge in the pattern, and this gives you the factor to multiply the stitch counts by in order to create the pattern with your new yarn. In this case, my factor is 1.33, so everytime in the pattern there is a stitch count, simply multply that count by 1.333 and you will get the correct number of stitches to cast on.
In order to get the correct row gauge, you would divide the replacement yarn row gauge by the patter row gauge. If I got 8 rows per inch with my swatch, then I would know to divide 8 by the required number of rows in the pattern, which, in this case, also ends up being 1.333. Chances are, you will get a number with a decimal.
Now that I have this information, I can go through and write the correct numbers down on the photocopy of the pattern and then start knitting merrily away.
And always write these factors and the yarn used into a notebook for future reference, as well as save that swatch.