MID(string, starting_at, extract_length)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
string:
The text string from which you want to extract a substring.
starting_at:
The position in the string where the extraction begins. The first character in the string is position 1.
extract_length:
The number of characters to extract from the string, starting from the starting_at position.
The MID function in Google Sheets is a text function used to extract a specific number of characters from a string, starting at a specified position. This function is particularly useful when you need to isolate a portion of text from a larger string, making it easier to manipulate and analyze data.
In simpler terms, MID allows you to pull out a segment of text from a longer string based on your specified criteria.
Imagine you have a list of product codes that include both letters and numbers, and you want to extract a specific part of these codes for further analysis.
| ProductCode |
|---|
| ABC123XYZ |
| DEF456UVW |
| GHI789RST |
You want to extract the numeric part of each product code, which starts from the 4th character and is 3 characters long.
To achieve this, you would use the MID function as follows:
=MID(A2, 4, 3)In this formula:
A2 is the cell containing the ProductCode.4 is the starting position from which to begin extracting characters.3 is the number of characters to extract.When you apply the MID formula to the Product Codes Table, the output would look like this:
| ProductCode | NumericPart |
|---|---|
| ABC123XYZ | 123 |
| DEF456UVW | 456 |
| GHI789RST | 789 |
In this case, the MID function successfully extracts the numeric part of each product code.
MID is beneficial because it allows for precise text manipulation within your data. It simplifies the process of extracting specific segments of text, which can be crucial for data analysis, reporting, and data cleaning tasks.
The MID function is an essential tool for anyone working with text data in Google Sheets, providing a straightforward way to enhance data analysis and reporting capabilities.
Happy spreadsheeting!
You have a list of product codes in Column A and need to extract the middle three characters for categorization. Using the MID formula, you can easily pull these characters into Column B, streamlining your inventory management and analysis process.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets 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.