How to Use the Excel MID Function
How to Use the Excel MID Function GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Software & Apps > MS Office
The formula's parameters break down as follows: The first parameter ("A1" in the example above): This is the target of the function, and should represent some text. One option is for you to put the text directly in this spot, surrounded by quotes. But more likely it'll be a cell containing said text. Note that if the cell contains a number, it will be treated like text.The second parameter ("17" in the example above): This is the offset, or the number of the character on which you want to start the extraction, inclusive. This should be a whole number (i.e. without any quotes) greater than one. The MID function will begin the extraction after counting to the right, one character at a time, based on the value you provide here. Note that if you enter a number that's greater than the target's total length, the result will be calculated as "empty text" (i.e. ""). If you enter a zero or negative number, you'll get an error.The last parameter ("4" in the example above): This is the length of the extraction, meaning how many characters you want. Like the offset, they're counted one character at a time, to the right, and starting with the character after the offset.
How to Use the Excel MID Function
This function helps you extract text from a cell
By Aaron Peters Aaron Peters Writer Villanova University Aaron Peters is a writer with Lifewire who has 20+ years experience troubleshooting and writing about consumer and business technology. His work appears in Linux Journal, MakeUseOf, and others. lifewire's editorial guidelines Updated on July 20, 2022 Tweet Share Email Tweet Share EmailIn This Article
Expand Jump to a Section What is the MID Function The MID Function in Action MIDB the More Complicated SiblingWhat to Know
MID function: =MID(A1,17,4). Examples A1 = target, 17 = offset, and 4 = length of extraction.Select target cell > input MID function > set values for function target, character offset, and extraction length. This article explains how to use the MID function in Excel for Microsoft 365, Excel Online, and Excel 2016 and 2019 for both Windows and macOS.What is the MID Function
The MID function allows you to extract text from the middle of a string. Like other functions, you use it by entering a formula in a cell that contains the function and it's parameters. The following represents what a typical MID formula looks like: =MID(A1,17,4)The formula's parameters break down as follows: The first parameter ("A1" in the example above): This is the target of the function, and should represent some text. One option is for you to put the text directly in this spot, surrounded by quotes. But more likely it'll be a cell containing said text. Note that if the cell contains a number, it will be treated like text.The second parameter ("17" in the example above): This is the offset, or the number of the character on which you want to start the extraction, inclusive. This should be a whole number (i.e. without any quotes) greater than one. The MID function will begin the extraction after counting to the right, one character at a time, based on the value you provide here. Note that if you enter a number that's greater than the target's total length, the result will be calculated as "empty text" (i.e. ""). If you enter a zero or negative number, you'll get an error.The last parameter ("4" in the example above): This is the length of the extraction, meaning how many characters you want. Like the offset, they're counted one character at a time, to the right, and starting with the character after the offset.