MID

The MID function returns a specified number of characters from a text string, starting at the position you specify. When used with a number, the function returns the result as text.

Syntax

MID(text, position, length)

Arguments

  • text: The text string that contains the characters to extract.
  • position: The starting position of the characters to extract.
  • length: The number of characters to return from the text.

Return value

Returns the specified number of characters from the text string.

Example

MID(Product Code, 8, 4)

In this example, the MID function extracts 4 characters from the Product Code field starting at position 8 to create a shorter product code. For example, Product0101001 returns 0101.

Excel equivalent

MID

Fabric Plan
Enterprise planning, integrated with PowerTable and Intelligence, native to Microsoft Fabric. Co-engineered with Lumel.
CERTIFIED BY
Fabric Planning is certified by IBCS
Microsoft, Azure, Copilot, Excel, Fabric IQ, Microsoft Entra, Microsoft Fabric, Microsoft Teams, OneLake, Outlook, Power Automate, Power BI and SharePoint are trademarks of the Microsoft group of companies. IBCS is a registered trademark of IBCS Association. All other trademarks are the property of their respective owners.

This community is operated independently by Lumel. Nothing on this site constitutes a representation or warranty by Microsoft.