Need to extract a specific part of text in a cell? The MID function is your answer.

In spreadsheet tasks, you often need to extract part of a text—for example, pulling out the birthdate from a social security number or getting the middle digits from a product code. That’s where the MID function comes in handy.


🔍 What is the MID Function?

The MID function extracts a specified number of characters from a string, starting at a given position.

This function is available in both Excel and Google Sheets and is commonly used for text manipulation.


📘 Function Syntax

MID(text, start_num, num_chars)
  • text: The target string or cell
  • start_num: The position to start extracting from (starting at 1)
  • num_chars: The number of characters to extract

✨ Example 1: Extracting a birthdate from a social security number

Column AColumn B (Formula)Result
990101-1234567=MID(A2, 1, 6)990101

Extracts the first 6 digits—typically the birthdate portion.


✨ Example 2: Extracting category from a product code

Column AColumn B (Formula)Result
ABC-123-XYZ=MID(A2, 5, 3)123

Pulls 3 characters starting from the 5th—middle category code.


✨ Example 3: Extracting fixed format text segments

Column AColumn B (Formula)Result
OrderNo:2025-KD-0001=MID(A2, 6, 9):2025-KD

If the structure is consistent, MID can grab exactly the part you need.


✨ Example 4: Extracting part of the tail end of a string

Column AColumn B (Formula)Result
ABCDEFGHIJKLMN=MID(A2, 10, 3)JKL

Grabs 3 characters from the 10th position—useful for slicing long text.


🧩 Practical Tips

  • Combine MID with functions like FIND, SUBSTITUTE, or LEN for dynamic slicing.
  • For flexible text positions, MID is more powerful than LEFT or RIGHT.
  • Ideal for structured data like order numbers, product codes, or formatted identifiers.

✅ Summary

FunctionPurpose
MIDExtracts characters from the middle of a string
Best Use CasesIDs, product codes, order numbers, etc.

Similar Posts

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다