# Google Sheets MID Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/mid-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The MID function extracts a specific number of characters from a text string, starting at a designated position.

```
MID(string, starting_at, extract_length)
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the MID you need in plain EnglishGenerate Formula

## Parameters

**`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.

## What is a MID Function?

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.

## A Practical Example

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.

### Product Codes Table:

| 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.

## MID Formula

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.

## Result of the Formula

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.

## Why Use MID?

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.

## Key Takeaways:

- **MID**: A text function that extracts a specified number of characters from a string, starting at a defined position.
- **Text Manipulation**: Useful for isolating specific segments of text for analysis or reporting.
- **Common Use Cases**: Ideal for data cleaning, parsing product codes, and any scenario where specific text extraction is necessary.

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!

## Example use case

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.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Password Protect An Google Sheets File](https://betteranalyst.com/google-sheets/how-to-password-protect-an-google-sheets-file)
- [How To Remove Blank Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-blank-rows-in-google-sheets)
- [How To Remove Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-duplicates-in-google-sheets)
- [How To Separate Names In Google Sheets](https://betteranalyst.com/google-sheets/how-to-separate-names-in-google-sheets)
- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)
- [How To Strikethrough In Google Sheets](https://betteranalyst.com/google-sheets/how-to-strikethrough-in-google-sheets)
- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
