MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.

Syntax

MID(text, startNumber, numberOfCharacters)

  • text (Required) The text string containing the characters you want to extract.
  • startNumber (Required) The position of the first character you want to extract in text. The first character in text has start_num 0, and so on.
  • numberOfCharacters (Required) Specifies the number of characters you want MID to return from text.

Remarks

If startNumber is greater than the length of text, MID returns "" (empty text).

If startNumber is less than the length of text, but startNumber plus numberOfCharacters exceeds the length of text, MID returns the characters up to the end of text.

Example

Field 1: Fluid Flow

FormulaDescriptionResult
=MID([Field 1],0,5)Returns 5 characters from the string in Field 1, starting at the 1st character.Fluid
=MID([Field 1],6,20)Returns 20 characters from the string in Field 1, starting at the 7th character. Because the number of characters to return (20) is greater than the length of the string (10), all characters, beginning with the 7th, are returned. No empty characters (spaces) are added to the end.Flow
=MID([Field 1],20,5)Because the starting point is greater than the length (10) of the string, empty text is returned.