MID worksheet function for Excel – Reference

MID worksheet function for Excel – Reference

MID worksheet function for Excel - Reference - Excel Effects

Overall, the MID worksheet function in Excel returns the characters from the middle of a text string, given a starting position and length.

MID worksheet function

Here is the syntax of the MID function.

Syntax

=MID(Text, Start_num, Num_chars)

Arguments

Below are the arguments of the MID function.

ArgumentDescription
TextA text string from which you want to extract characters.
Start_numA number representing the position of the first character to extract. The first character of Text is 1.
Num_charsA number specifying how many characters to return from Text.

Example(s)

Example 1
Return five characters from a cell, starting at position 5
Firstly, =MID(A2, 5, 5) returns five characters from cell A2, starting at position 5.
Example 2

If you want to get all the characters after a certain position, then you can use a function like:

=MID(A2, 5, 3000)

Basically, you put a super huge number for the Num_chars argument. As a result, this ensures that all characters in Text are shown.

Example 3
MID worksheet function for Excel - Extract single characters.
Thirdly, =MID($A2,B$1,1) displays a single character from column A, starting at a position from row 1. So, we only created this function once. Therefore, all we have to do is copy/paste it to the cells we want to show a character.

So, the above example shows you how you can extract each character from a string. All in all, it uses the number from the top row as the Start_num. Below is the function we use in the above screenshot.

=MID($A2,B$1,1)


Excel functions  Reference home