The above formula outputs the string "Massachusetts", because that string begins 9 characters into the full string Boston, Massachusetts, USA and is 13 characters long.
MID in practice
In practice, MID is usually combined with other text-manipulation functions like SEARCH and RIGHT to dynamically extract values from sets of strings. We usually can't use MID on its own, because start_num is often unknown. For example, consider the following sheet, in which a number of US cities are listed by zip code:
Let's say we want to create a new column of data that extracts state names from each string. We can't use MID on its own, because our start_num will be different for each line (because each city name is a different length). So, we'll combine it with SEARCH to get the data we need:
=MID(B3,SEARCH(",",B3)+2,2) Output: "MA"
The above formula is complicated, but it pulls the results we want! Let's walk through it step by step to get a feel for how it works:
First, we call a MID function on cell B3. How do we know how far into cell B3 to start pulling text? Well, we'll SEARCH for the first occurence of a comma character (,) within Cell B3, which we know comes directly before the state name. When we find it, we add 2 to the position in question, because we know the state abbreviation begins 2 characters after the comma in each string. Then, we close our SEARCH function and ask MID to pull 2 characters from its starting point, which outputs the abbreviation of the state in question.
As you can see, combining MID with other string manipulation functions can produce some powerful results, allowing us to parse input strings in a huge variety of ways. These formulas can often become complex, so it takes a while to get your head wrapped around them — but once you do, you'll be well on the way to extracting any value you want from a given string quickly and dynamically!
Here's another example of MID used in practice to pull a state name from a larger string. This time, the length of the string we're pulling out is variable — meaning that rather than a known 2-letter state abbreviation, it can be any length. This one is even more complex. Can you tell how it works?