How to Use Excel MID Function (Examples + Video)

When to use Excel MID Function

MID function can be used to extract a specified number of characters from a string.

What it Returns

It returns the sub-string from a string.


=MID(text, start_num, num_chars)

Input Arguments

  • text – the text from which you want to extract the string.
  • start_num – the starting position within the text argument, from where the extraction should begin.
  • num_chars – the total number of characters that you want to extract.

Additional Notes

  • Spaces are counted as characters.
    • To remove extra spaces, use TRIM function.
  • If the start number is greater than the length of the text, MID returns “” (empty text).
  • Returns an error if:
    • The start number is less than 1.
    • The number of characters is a negative number.

Add a Comment

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