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
ArgumentDescription
stringThe string to extract a segment from.
starting_atThe index from the left of string to begin extracting (1-indexed).
extract_lengthThe length of the segment to extract.
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_at exceeds the string length, MID returns an empty string (not an error).
Related formulas
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.
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.