MID Function
Extracts a specific number of characters from the middle of a text string, starting at any position.
ExcelGoogle Sheets
Sintaxis
MID(text, start_num, num_chars)Parámetros
| Parámetro | Descripción |
|---|---|
| text | The text string or cell reference. |
| start_num | The position of the first character to extract (1-based). |
| num_chars | The number of characters to extract. |
Ejemplos
Extract middle portion of a code
=MID("ABC-1234-XY", 5, 4)Resultado: 1234
Extract month from a date string
=MID("2024-03-15", 6, 2)Resultado: 03
Consejos y buenas prácticas
- •start_num is 1-based (first character is position 1, not 0).
- •If start_num + num_chars exceeds the string length, MID returns all available characters.
- •Use FIND or SEARCH to dynamically locate the start position.
Fórmulas relacionadas
¿Necesitas otra fórmula?
Describe lo que necesitas en texto simple y nuestra IA generará la fórmula por ti.
Probar el Generador de fórmulas