Excel MID Function
Chala mitrano — mID is the middle scissors. Tell Excel where to start and how many letters to keep.
चला मित्रांनो — MID मधली कात्री आहे. कुठून सुरू करायचे आणि किती अक्षरे ठेवायची ते सांगा.
चलो दोस्तों — MID बीच की कैंची है. कहाँ से शुरू करना है और कितने अक्षर रखने हैं, बताओ.
Purpose
Return characters from the middle of a text string, starting at a position you choose.
Return value
The middle slice as text.
Syntax
Arguments
| Argument | Required? | Description |
|---|---|---|
text | Required | The full text. |
start_num | Required | 1-based start position (1 = first character). |
num_chars | Required | How many characters to take from that start. |
Version
All Excel versions. LibreOffice Calc compatible.
How to use — Why → What → How
Why: Invoice INV-PUNE-7781 hides a city code in the middle. Ops in Austin use INV-AUS-2201. You need that city token without rebuilding the ID by hand. MID rewards careful layout audits. Print ten sample IDs, mark start positions with a pen, then lock start_num. When layouts drift by region, FIND must drive the start — never a lucky hard-coded 5.
What: MID starts at start_num and returns num_chars characters. Positions count from 1 at the left. Read every argument in the table once before you type; each one changes the answer on purpose.
How — numbered steps:
- Type =MID(
- Select the text cell.
- Comma, start position (example 5).
- Comma, length (example 4).
- Enter and fill down.
- Verify with LEN that every ID shares the same layout before you trust a fixed start.
- When the start moves, nest FIND to compute start_num.
- Keep results as text unless VALUE is required.
Ravindra Bagale's Tip
Friends, start_num is 1-based: the first character is 1, not 0. Programmers often slip here in interviews.
Ravindra Bagale's Tip – मराठी
मित्रांनो, start_num 1 पासून सुरू: पहिले अक्षर 1, 0 नव्हे. Interview मध्ये programmers इथे चुकतात.
Ravindra Bagale's Tip – हिंदी
दोस्तों, start_num 1 से शुरू: पहला अक्षर 1 है, 0 नहीं. Interview में programmers यहाँ फिसलते हैं.
Ravindra Bagale's Tip
Friends, sleep on MID and rebuild example 1 tomorrow without looking. That five-minute test beats rereading the whole page.
Ravindra Bagale's Tip – मराठी
मित्रांनो, MID वर एक रात्र झोपा आणि उद्या उदाहरण 1 न पाहता पुन्हा लिहा. पाच मिनिटांची ही चाचणी पूरे पृष्ठ वाचण्यापेक्षा जास्त मदत करते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, MID पर एक रात सोकर कल उदाहरण 1 बिना देखे फिर लिखो. पाँच मिनट का यह टेस्ट पूरा पेज पढ़ने से ज़्यादा मदद करता है.
Ravindra Bagale's Tip
Friends, after you finish MID, open yesterday’s real workbook and find one place this function would have saved ten minutes. That habit turns lessons into salary skills.
Ravindra Bagale's Tip – मराठी
मित्रांनो, MID शिकून झाल्यावर कालची खरी वर्कबुक उघडा आणि शोधा जिथे हे फंक्शन दहा मिनिटे वाचवू शकले असते. ही सवय धड्यांना पगाराची कौशल्ये बनवते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, MID सीखने के बाद कल की असली वर्कबुक खोलो और ढूँढो जहाँ यह फ़ंक्शन दस मिनट बचा सकता था. यही आदत पाठ को सैलरी स्किल बनाती है.
Download practice file: practice-mid.xlsx (includes sheet About this data, practice sheets, and Answers).
Worked examples
1) City code inside invoice
Pune billing.
| Invoice | Amount (₹) |
|---|---|
| INV-PUNE-7781 | 24500 |
| INV-NASH-7782 | 18200 |
| INV-PUNE-9001 | 31000 |
Result: PUNE
What it means: Characters 5–8 are PUNE.
2) Digits in the middle
Austin SKU block.
| SKU |
|---|
| ABCD1234XYZ |
| ABCD9999XYZ |
Result: 1234
What it means: Middle four digits as text.
3) Single character
Pick one letter.
| Code |
|---|
| QX9-HELLO |
Result: 9
What it means: Third character only.
4) Start past end
Start too far.
| Code |
|---|
| ABC |
Result:
What it means: Empty text — not an error — when start is beyond the length.
5) With FIND for flexible start
After the first dash.
| Invoice |
|---|
| INV-PUNE-7781 |
| INV-NASH-12 |
Result: PUNE
What it means: FIND locates the dash; MID takes the next 4.
6) Name middle initial zone
Compact codes.
| Token |
|---|
| R-K-BAGALE |
| A-S-SHAH |
Result: K
What it means: Middle initial K.
Common errors and fixes
Notes and tips
- MID returns text.
- Empty string when start is past LEN(text).
- Pair with FIND when the start moves.
- Fixed-layout IDs are common in ERP exports from Indian manufacturers and US 3PLs. MID bridges LEFT/RIGHT and FIND-based parsing. Always sample ten IDs before locking start_num in a shared workbook.
- MID vs TEXTBEFORE/TEXTAFTER: delimiter functions need Microsoft 365/2021 and read clearer when a dash marks the cut. MID works on every Excel version.
- Fictional sample data only — practice amounts and names are made for learning.
- After the 10 tasks, re-read the errors table once.
- Say the business question in plain words before you type equals.
- Keep a scrap sheet for experiments so you do not overwrite class files.
- Fill formulas down only after the first row looks correct.
- When two answers look possible, write both on paper then test in Excel.
- MID rewards careful layout audits. Print ten sample IDs, mark start positions with a pen, then lock start_num. When layouts drift by region, FIND must drive the start — never a lucky hard-coded 5.
- Revisit the MID errors table after the quiz — most classroom mistakes are listed there.
- Build one brand-new example on a blank sheet from memory before you close the laptop.
- If a result looks wrong, check spaces with LEN and case with exact equals before changing the formula.
- Share one tip from this page with a classmate in Marathi or Hindi — teaching locks the idea.
- Keep currency symbols consistent inside a single report column even when practice mixes ₹ $ £ € across examples.
- When Excel versions differ at home and in class, write the fallback formula under the modern one in a comment cell.
- Print the revision card for MID and stick it near your monitor for one week of real worksheets.
- When helping a junior, ask them to predict the result before pressing Enter — prediction builds judgement.
- Keep a personal notebook of the one mistake you make most often with this function; review it monthly.
In real work
Fixed-layout IDs are common in ERP exports from Indian manufacturers and US 3PLs. MID bridges LEFT/RIGHT and FIND-based parsing. Always sample ten IDs before locking start_num in a shared workbook. MID rewards careful layout audits. Print ten sample IDs, mark start positions with a pen, then lock start_num. When layouts drift by region, FIND must drive the start — never a lucky hard-coded 5. Classroom drill: write three brand-new MID formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose (wrong case, wrong start, extra space) and watch the error; recovering from that break is half of interview readiness.
How it compares
MID vs TEXTBEFORE/TEXTAFTER: delimiter functions need Microsoft 365/2021 and read clearer when a dash marks the cut. MID works on every Excel version.
Interview corner
- Is start_num 0-based or 1-based?
- 1-based.
- What if start is beyond the text?
- Empty string.
- How do you take text between two dashes?
- Combine FIND (or TEXTBEFORE/TEXTAFTER on 365).
Related functions
Practice tasks (10)
- Task 1. Return PUNE from INV-PUNE-7781 with MID.Hint: start at position 5, take 4.
- Task 2. Fill city codes for three invoices.Hint: same start if layout matches.
- Task 3. Pull 1234 from ABCD1234XYZ.Hint: start 5, length 4.
- Task 4. Third character of QX9-HELLO.Hint: length 1.
- Task 5. What does MID return when start is 10 on ABC?Hint: try it — notice there is no red error.
- Task 6. After-dash city using FIND+MID.Hint: FIND gives the dash position.
- Task 7. Middle initial from R-K-BAGALE.Hint: position 3.
- Task 8. Note in a cell: is start_num 0-based?Hint: test MID(A2,1,1).
- Task 9. Compare fixed MID with FIND-based MID on two layouts.Hint: change one invoice format.
- Task 10. Explain when TEXTBEFORE would replace your MID.Hint: delimiter clarity.
Quick quiz
Answers: Q1=PUNE, Q2=1, Q3=Empty text, Q4=FIND inside MID, Q5=Text (check after you try).
Revision card
Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.