Formulyo

Excel + Google Sheets · MID

Take text from the middle

Returns a number of characters starting at the position you choose.

The formula

=MID(A2, 5, 4)

What each part means

Example

Before
AB
1InvoiceYear
2INV-2026-0451
3INV-2025-1187
4INV-2026-0032
After
AB
1InvoiceYear
2INV-2026-04512026
3INV-2025-11872025
4INV-2026-00322026

Step by step

  1. Click cell B2.
  2. Type the formula: =MID(A2, 5, 4)
  3. Press Enter.
  4. Drag the small square in the bottom-right corner of the cell down to copy it to the other rows.

Where it works

The same formula in other languages

Get 1 formula a day, free

Plus a free weekly planner template for Excel and Google Sheets. Unsubscribe in 1 click.

✓ Done! Check your inbox to confirm.

Want ready-made templates? See the Formulyo pack →

Keep learning