Return characters from the middle of a text string, given a start position and length.
Syntax
MID(text, start_num, num_chars)Arguments
textrequired
The text to extract from.
start_numrequired
The position of the first character to return.
num_charsrequired
How many characters to return.
MID extracts a substring starting at any position. Combined with FIND or SEARCH, it pulls values from between delimiters — for example, the text between two slashes or after a code prefix.
=MID("AB-1234-X", 4, 4)→1234Returns 4 characters starting at position 4.
Find the start
Count or use FIND to locate the first character position.
Set the length
Specify how many characters to pull.
Replace the fixed numbers with FIND, e.g. MID(A2, FIND("-",A2)+1, 4), so it adapts to each row.