--- title: "Use the MID Function to Extract Characters from a Specific Position" slug: "mid-function" description: "Learn to apply the MID function in Pigment to extract a specific number of characters from any text field, starting at your chosen position." updated: 2025-05-30T09:42:19Z published: 2025-08-22T10:57:28Z canonical: "kb.pigment.com/mid-function" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.pigment.com/llms.txt > Use this file to discover all available pages before exploring further. # MID function ## ​​​Description Extracts a given number of characters from a Text, starting at a given position. ## Syntax `MID(Text to Extract, Starting Position, Number of Characters)` ## Arguments | Argument | Type | Dimensions | Description | | --- | --- | --- | --- | | *Text to Extract* (required) | Text | Any Dimensions | Text to extract characters from. | | *Starting Position* (required) | Integer | No Dimension or Dimensions of *Text to Extract* | Starting position of Text to Extract to extract characters from. | | *Number of Characters* (required) | Integer | No Dimension or Dimensions of *Text to Extract* | Number of characters to extract from the *Starting Position*. | ## Returns | Type | Dimensions | | --- | --- | | Text | Dimensions of *Text to Extract* | Extracted characters from *Text to Extract*. `BLANK` if *Starting Position* is a negative integer or 0. `BLANK` if *Number of Characters* is a negative integer. ## Examples | Formula | Result | Description | | --- | --- | --- | | `MID(“abc”, 3, 1)` | “c” | Starting from the third character, one character is extracted. | | `MID(“abcde”, 2, 3)` | “bcd” | Starting from the second character “b”, the next three characters are extracted. | | `MID(“a”, -1, 1)` | `BLANK` | The *Starting Position*, -1, is invalid. | | `MID(“a”, 1, -1)` | `BLANK` | The *Number of Characters*, -1, is invalid. | ## See also Excel: [MID](https://support.microsoft.com/en-us/office/mid-midb-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028) Related articles: [RIGHT](/v1/docs/right-function), [LEFT](/v1/docs/left-function) > [!TIP] > More of a hands-on learner? > > Talk to your Customer Success Manager about downloading the Functions and Modifiers in Pigment Application into your workspace. It includes examples of every formula and modifier in Pigment!