=MID(text, start_num, num_chars)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
Need more than a single MID formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.
text:
The text string from which you want to extract a substring. This can be a text string, a cell reference containing text, or a formula that returns text.
start_num:
The position of the first character you want to extract from the text. The first character in the text string is at position 1.
num_chars:
The number of characters you want to extract from the text, starting from the position specified by start_num.
The MID function in Excel is a text manipulation tool that allows you to extract a specific number of characters from a text string, starting at a designated position. This function is particularly useful when you need to isolate a portion of text from a larger string, making it easier to analyze or manipulate data.
In simpler terms, the MID function helps you extract substrings from text, which can be essential for data cleaning and formatting tasks.
Imagine you have a list of product codes in an Excel spreadsheet, and you want to extract the model number from each code.
| Product Code |
|---|
| ABC-1234-XYZ |
| DEF-5678-QWE |
| GHI-9101-RTY |
| JKL-1121-UIO |
| MNO-3141-PAS |
You want to extract the model number, which is the four characters starting from the fifth position in each product code.
To extract the model number from the product codes, you would use the MID formula as follows:
=MID(A2, 5, 4)When you apply the formula to each product code, it extracts the model numbers as follows:
| Model Number |
|---|
| 1234 |
| 5678 |
| 9101 |
| 1121 |
| 3141 |
Here, the extracted model numbers correspond to the four characters starting from the fifth position in each product code.
The MID function is particularly useful when you need to extract specific parts of text strings for analysis or reporting. It allows you to manipulate text data efficiently without the need for complex formulas or manual editing.
Understanding how to use the MID function can significantly enhance your data manipulation capabilities in Excel, enabling you to work more effectively with text data.
Happy extracting!
You have a list of product codes in Column A, where each code consists of a combination of letters and numbers. You want to extract a specific part of each product code, such as the numeric portion, which starts from the 5th character and is 3 characters long. By using the MID function, you can easily extract this numeric portion for further analysis or reporting. This simplifies the process of data manipulation and allows for better organization of product information without the need for complex string functions.
Beyond the MID function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.
Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.
Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.
Browse our complete library of Excel formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.