ExcelFormulas logoExcelFormulas.
Preguntar a IA
LógicasVerificado por QA

SWITCH.

Evaluates an expression against a list of values and returns the matching result.

Lógicas
ExcelExcel 365Excel 2021Excel 2019Google Sheets

Cómo funciona.

SWITCH es una función fundamental de Excel. Evaluates an expression against a list of values and returns the matching result. Permite automatizar hojas de cálculo, simplificar fórmulas complejas y analizar datos con total precisión en Microsoft Excel y Google Sheets.

Sintaxis.

Notación Estándar de Excel
=SWITCH(expression, val1, result1, [default])
Consejo: Los argumentos entre corchetes [como_este] son opcionales; todos los demás son obligatorios.

Argumentos.

A continuación se detallan todos los parámetros aceptados por esta función.

expressionObligatorio

The value to evaluate.

Ejemplo: A2
val1Obligatorio

First value to test for equality.

Ejemplo: 1
result1Obligatorio

Output returned if expression matches val1.

Ejemplo: "Sunday"

Ejemplo práctico.

Caso de Uso Paso a Paso

Day Number to Name Mapping

Convert numeric day codes into weekday names.

Day CodeWeekday Name
2—
1—
3—
Fórmula Aplicada
=SWITCH(A2, 1, "Sunday", 2, "Monday", 3, "Tuesday", "Other")
Resultado Esperado::Monday

Evaluates SWITCH over the sample table cells, placing the verified output in cell B2.

Generador de fórmula.

Abrir Asistente Completo

Personaliza los campos de argumento a continuación para generar una fórmula lista para copiar y pegar en tu hoja de cálculo.

Generated FormulaLista para copiar

Comportamiento del resultado.

Returns "Monday" based on sample evaluation criteria and active cell references.

Resultado de Muestra::Monday
Tipo de Salida::Text

Buenas Prácticas

  • Always specify an optional default value at the end to catch unanticipated inputs.

Errores Frecuentes

  • If no value matches and no default argument is provided, SWITCH returns #N/A.
Base de Compatibilidad

Compatibilidad de plataforma y versiones.

Matriz verificada con base en los motores de cálculo oficiales de Microsoft Excel y Google Sheets.

Excel✓
Compatible
Excel 365✓
Compatible
Excel 2021✓
Compatible
Excel 2019✓
Compatible
Google Sheets✓
Compatible
Disponibilidad y Versiones de Microsoft Excel

Introduced in Excel 2019 and Excel 365. Supported in Excel 2019, 2021, and 365.

Notas sobre Compatibilidad con Google Sheets

100% compatible with Google Sheets with identical expression evaluation rules.

Preguntas frecuentes.

Dudas Técnicas
Can I use SWITCH across different worksheets in Excel?↓

Yes. You can reference cells located on other sheets by including the sheet name followed by an exclamation mark, for example: =SWITCH(Sheet2!A2:A10). If the sheet name contains spaces, enclose it in single quotes: ='Q1 Report'!A2:A10.

What is the most common reason for errors in SWITCH?↓

If no value matches and no default argument is provided, SWITCH returns #N/A.

Does SWITCH work identically in Google Sheets?↓

Yes, SWITCH is supported in both Microsoft Excel and Google Sheets with standard evaluation behavior.