Product codes can be very long and confusing, so you may want to extract a certain number of characters from a string. Excel provides three functions for this purpose: **LEFT, RIGHT and MID**. These are very useful on their own, but the formulas are even more powerful when combined with FIND. Suppose your product codes always follow a specific pattern consisting of letters, numbers, and hyphens: ABCDE-A-12345-T. You want to extract the numerical part in the middle.

However, because the string **does not have a fixed length**, you can’t use the basic extract functions. These functions require a specific number of characters, which you can’t easily provide in this case. But thanks to the hyphens, you can use the FIND function. It gives you the position information you need.

Since there are multiple hyphens in the string, you have to** nest the FIND function**. In this example, we’re assuming that the number part always contains five characters.