How to use MID Function in Excel

The MID function can help you to extract a specified number of characters from a text, starting from a specified position.

In simple words, you can specify that how many characters you want to extract, starting from a particular position.

In the below example, we have used mid to extract “Champs” from “ExcelChamps.com” by the specifying position of the first letter of the required text string and the number of characters required.

extract text champ from the text using mid function in excel

Syntax

MID(text,start_num,num_chars)

  1. text A text or number from which you want to extract some characters.
  2. start_char Position of character from where you want to extract characters.
  3. num_chars Number of characters you want to extract from the start_char.

Example

In the below example, we have used different values in function arguments for your better understanding.

simple examples to understand usages mid function in excel
  1. From 6th character to next 6 characters extracted.
  2. From 6th character to next 10 characters extracted.
  3. We have used starting character in negative and it has returned an error.
  4. By using 0 for the number of characters to extract & it has returned a blank.
  5. With negative number for the number of characters to extract & it has returned an error.
  6. Starting number is zero and it has returned an error.
  7. Text string directly into the function.

Remember

Sample File