Texteasy
MID()
Returns a segment of a string starting at a given position, for a given length.
Syntax
fx
=MID(string, starting_at, extract_length)
Arguments
Example
fx
=MID("Anthropic", 2, 4)
Paste this into Google Sheets to run it. The live playground on this site covers 24 of the 61 functions, and MID isn't one of them yet.
Common pitfalls
- Indices are 1-based.
MID("abc", 1, 1)returns"a", not"b". - If
starting_atexceeds the string length, MID returns an empty string (not an error).
Related formulas
Used by
LEFT()
Returns a substring from the beginning of a specified string.
RIGHT()
Returns a substring from the end of a specified string.
LEN()
Returns the number of characters in a string.
FIND()
Returns the position of a substring within a string. Case-sensitive.
SEARCH()
Returns the position of a substring within a string. Case-insensitive.
REPLACE()
Replaces part of a string with another string at a specific character position.
REGEXEXTRACT()
Returns the first matching substring (or first capture group) of a regular expression.