---
title: "MID function in Excel: syntax and examples | PracticeExcel"
description: "How to use MID in Excel and Google Sheets: cut a piece out of the middle of a text."
canonical_url: "https://practiceexcelonline.com/functions/mid"
locale: en
meta:
  "og:description": "How to use MID in Excel and Google Sheets: cut a piece out of the middle of a text."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~TUlEIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNSUQgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IGN1dCBhIHBpZWNlIG91dCBvZiB0aGUgbWlkZGxlIG9mIGEgdGV4dC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TUlEKHRleHQsIHN0YXJ0X251bSwgbnVtX2NoYXJzKQ%2Cp_Ii9mdW5jdGlvbnMvbWlkIg%2Cs_vTySnIjlJUx8IpES.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "MID function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~TUlEIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNSUQgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IGN1dCBhIHBpZWNlIG91dCBvZiB0aGUgbWlkZGxlIG9mIGEgdGV4dC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TUlEKHRleHQsIHN0YXJ0X251bSwgbnVtX2NoYXJzKQ%2Cp_Ii9mdW5jdGlvbnMvbWlkIg%2Cs_vTySnIjlJUx8IpES.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The MID function**

Returns a number of characters from the middle of a text, starting at a given position.

=

MID(

## **Syntax**

```
MID(text, start_num, num_chars)
```

<dl><dt>**text **</dt>
<dd>The text to take characters from.</dd>
<dt>**start_num **</dt>
<dd>The position of the first character, from 1.</dd>
<dt>**num_chars **</dt>
<dd>How many characters to return.</dd></dl>

## **Examples**

C1`=MID(<sup>1</sup>A2,<sup>2</sup>4,<sup>3</sup>4)`

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **2100** |
| 2 | DK-2100 |  | |

**In plain words:** Take <sup>3</sup>4 characters of <sup>1</sup>the code in A2, <sup>2</sup>starting at character 4.

C1=MID(A2,1,2)

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **DK** |
| 2 | DK-2100 |  | |

## **Read the guide**

- [**How to clean data in Excel with formulas**](https://practiceexcelonline.com/learn/clean-data-in-excel)

## **Related functions**

- [**LEFT**](https://practiceexcelonline.com/functions/left)
- [**RIGHT**](https://practiceexcelonline.com/functions/right)
- [**FIND**](https://practiceexcelonline.com/functions/find)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/mid#webpage","@type":"WebPage","description":"How to use MID in Excel and Google Sheets: cut a piece out of the middle of a text.","name":"MID function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/mid","breadcrumb":{"@id":"https://practiceexcelonline.com/functions/mid#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/mid"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/mid#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"MID function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/mid#article","description":"How to use MID in Excel and Google Sheets: cut a piece out of the middle of a text.","headline":"MID function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~TUlEIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNSUQgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IGN1dCBhIHBpZWNlIG91dCBvZiB0aGUgbWlkZGxlIG9mIGEgdGV4dC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TUlEKHRleHQsIHN0YXJ0X251bSwgbnVtX2NoYXJzKQ%2Cp_Ii9mdW5jdGlvbnMvbWlkIg%2Cs_vTySnIjlJUx8IpES.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/mid#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/mid#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~TUlEIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNSUQgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IGN1dCBhIHBpZWNlIG91dCBvZiB0aGUgbWlkZGxlIG9mIGEgdGV4dC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TUlEKHRleHQsIHN0YXJ0X251bSwgbnVtX2NoYXJzKQ%2Cp_Ii9mdW5jdGlvbnMvbWlkIg%2Cs_vTySnIjlJUx8IpES.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~TUlEIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNSUQgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IGN1dCBhIHBpZWNlIG91dCBvZiB0aGUgbWlkZGxlIG9mIGEgdGV4dC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TUlEKHRleHQsIHN0YXJ0X251bSwgbnVtX2NoYXJzKQ%2Cp_Ii9mdW5jdGlvbnMvbWlkIg%2Cs_vTySnIjlJUx8IpES.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
