Saltar al contenido
GridBelt
  • Prueba de Excel
  • Práctica
  • Programas
  • Precios
Iniciar sesión
Empezar la prueba gratuita
  • Prueba de Excel
  • Práctica
  • Programas
  • Precios
Iniciar sesiónCrear cuenta
Empezar la prueba gratuita
GridBelt

Practica Excel en tu navegador.

Prueba de Excel

  • Nivel 1: Principiante
  • Nivel 2: Intermedio
  • Nivel 3: Experto
  • Prueba de Excel en 7 días
  • Clasificación
  • Prueba de Excel para entrevistas
  • Evaluación de Excel de Indeed

Práctica

  • Todos los ejercicios
  • Programas
  • Para principiantes

Guías

  • Fórmulas de Excel
  • Atajos de Excel

Empresa

  • Acerca de
  • Precios
  • Cómo corregimos

© GridBelt. Todos los derechos reservados.

  • Política de privacidad
  • Términos de uso
  • Política de reembolso

Excel es una marca comercial de Microsoft Corporation. Indeed, TestGorilla, SHL y otras marcas son propiedad de sus respectivos titulares. GridBelt es un sitio de práctica independiente y no está afiliado a Microsoft, TestGorilla, SHL ni Indeed, ni respaldado ni patrocinado por ellos.

  1. Práctica
  2. /
  3. Text functions

LEFT, MID and RIGHT practice: split 120 SKU codes into category, year and serial

  • Principiante
  • ~6 min
  • Text functions

Enunciado en inglés

A warehouse export lists 120 products whose SKU encodes three facts in a fixed pattern — category code, launch year, serial number — for example DEC-2019-1375: category DEC, launched in 2019, serial 1375. Purchasing wants to filter by category and compute each product's age, so the three parts must live in their own columns. Split every SKU into E (category), F (year as a number) and G (serial, keeping its leading zero — 15 of the serials start with 0).

Qué tienes que hacer

  1. 1Click E2 and type =LEFT(A2,3): the first three characters are the category code (DEC). Fill down to E121.
  2. 2Click F2 and type =MID(A2,5,4) to pull four characters starting at position 5 — the year. MID returns text, so wrap it: =VALUE(MID(A2,5,4)) or =MID(A2,5,4)*1 turns "2019" into the number 2019 (right-aligned). Fill down to F121.
  3. 3Click G2 and type =RIGHT(A2,4): the last four characters are the serial, kept as text so "0114" does not lose its leading zero. Fill down to G121.
  4. 4Fill each column with the fill handle or Ctrl+D (Windows) / ⌘D (Mac) on the selected range E2:E121, F2:F121, G2:G121.

Celdas de respuesta

Corrección

Escribe tu fórmula en la cuadrícula, presiona Enter y luego haz clic en Comprobar. Evaluamos el valor de cada celda de respuesta y la fórmula que lo produce.

Tareas

  1. Sin comprobarIn E2, use LEFT to extract the three-letter category code from the SKU in A2, then fill down to E121.
  2. Sin comprobarIn F2, use MID to extract the four-digit launch year (characters 5–8) and convert it to a number — MID returns text, so wrap it in VALUE or multiply by 1 — then fill down to F121.
  3. Sin comprobarIn G2, use RIGHT to extract the four-character serial number as text (so a leading zero is kept), then fill down to G121.

Para las tareas de hoja de cálculo se recomienda una pantalla grande. La hoja se desplaza dentro de este recuadro.

StartInsertFormulasDataView
A1fxPreparando tu libro…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Escribe tu fórmula en la hoja y luego comprueba.

Sobre este ejercicio

Un conjunto de datos de 120 filas en una hoja, 3 celdas de respuesta, unos 6 minutos. Se corrige en tu navegador: el valor y la fórmula que lo produce, con comentarios que te dicen qué arreglar.

Cómo resolverlo

  • E2=LEFT(A2,3)
  • F2=VALUE(MID(A2,5,4))
  • G2=RIGHT(A2,4)

LEFT, MID and RIGHT cut a fixed number of characters out of a text: LEFT(A2,3) takes the first three, RIGHT(A2,4) the last four, and MID(A2,5,4) four characters starting at position 5. They work here because every SKU follows the same 13-character pattern, so the positions never change from row to row. All three return text — which is exactly right for the serial (0114 keeps its zero) but wrong for the year, so the year is wrapped in VALUE to become a real number.

Pitfall 1 (the classic test trap): =MID(A2,5,4) shows 2019 left-aligned — it is text. SUM over the column returns 0, =F2>2022 compares alphabetically, and a filter lists "2019" under text values. VALUE, NUMBERVALUE, *1, +0 or the double unary -- all convert it. Pitfall 2: the opposite mistake on the serial — =VALUE(RIGHT(A2,4)) turns 0142 into 142 and the leading zero is gone for good; keep identifiers as text or re-pad with TEXT(n,"0000"). Pitfall 3: fixed positions break the moment a category code has two or four letters; for variable-width parts use FIND("-",A2) to locate the hyphen (see the e-mail split exercise) or TEXTSPLIT(A2,"-") in Excel 365. MID is forgiving: asking for more characters than remain simply returns what is there, so =MID(A2,10,99) is a common idiom for "everything after position 9". Version note: TEXTBEFORE, TEXTAFTER and TEXTSPLIT (Excel 365 only) do the same job without counting characters; LEFT/MID/RIGHT work in every version and in every other spreadsheet tool. Flash Fill (Ctrl+E) can guess these splits interactively, but it produces static values that do not update when a SKU changes — formulas do.

Otras formas válidas

  • =MID(A2,5,4)*1 or =--MID(A2,5,4) — arithmetic coercion instead of VALUE
  • =NUMBERVALUE(MID(A2,5,4)) — explicit conversion, locale-aware
  • =MID(A2,10,4) — the serial via MID instead of RIGHT (same text)
  • =TEXTBEFORE(A2,"-") / =TEXTAFTER(A2,"-",-1) — Excel 365 only, position-free

Errores frecuentes

Leaving the year as text: =MID(A2,5,4) returns "2019" (left-aligned, cannot be summed or compared as a number). Wrap it in VALUE or multiply by 1.

Cómo corregimos

Se acepta cualquier fórmula que produzca el resultado correcto, salvo que la tarea nombre una función: entonces otra función obtiene media puntuación. Comparamos los valores con una pequeña tolerancia y, en el texto, ignoramos mayúsculas y espacios. Un número correcto escrito a mano en lugar de una fórmula obtiene media puntuación. Las tareas de varias celdas obtienen la puntuación completa con el 100% de las celdas correctas y media puntuación desde el 50%. Cuando importa, también cambiamos una celda de entrada en una copia de tu hoja y comprobamos que tu fórmula se adapta.

Respuestas calculadas con las reglas de Excel 365 y comprobadas en nuestro corrector el 16 de noviembre de 2026. Autor: GridBelt team.

En estos programas

  • Excel test in 7 days, Plan del nivel 1Día 2
  • Excel for Data AnalystsDía 1
  • Excel for Administrative AssistantsDía 6

Ejercicios relacionados

  • Split email into user and domain (FIND/LEFT/RIGHT or TEXTBEFORE/TEXTAFTER)Intermedio, ~7 min
  • Full name with CONCAT or &Principiante, ~4 min
  • Turn text dates into real dates and group by monthExperto, ~12 min

Referencia de la función

Documentación oficial

Siguiente ejercicio

Split email into user and domain (FIND/LEFT/RIGHT or TEXTBEFORE/TEXTAFTER)