Using MID Function to Extract Characters from Middle of String

The MID function in Excel allows you to extract a set number of characters from the middle of a string.  For example you may have in cell A1 “1234Yes56”.  But in cell B1 we want to show just the “Yes” from the middle of the string.  So in cell B1 click and type

=MID(A1,5,3)

This tells Excel to go to cell A1, start from the left hand side and move 5 characters in (as denoted by the 5 after the first comma), and then from the fifth character extract only two characters from the string, as denoted by the 3 after the second comma.  The MID Function does’t have to start in the middle.  You could type =MID(A1,2,5) and this would start from the second character from the left and take the proceeding five characters from the string.  In this case it would take “234Ye”.

The MID function could also be combined with perhaps the LEFT and RIGHT function to then concatenate string sections together into a new string.

Leave a Reply

Your email address will not be published. Required fields are marked *