ExcelFormulas logoExcelFormulas.
KI Fragen
LogikQA-geprüft

SWITCH.

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

Logik
ExcelExcel 365Excel 2021Excel 2019Google Sheets

Funktionsweise im Detail.

SWITCH ist eine zentrale Formel in Excel. Evaluates an expression against a list of values and returns the matching result. Sie optimiert Ihre Tabellenkalkulationen, automatisiert Routineabfragen und sorgt für fehlerfreie Auswertungen in modernen Tabellen.

Syntax.

Standardmäßige Excel-Schreibweise
=SWITCH(expression, val1, result1, [default])
Tipp: Parameter in eckigen Klammern [wie_dieser] sind optional, alle übrigen müssen angegeben werden.

Argumente.

Alle von dieser Funktion akzeptierten Parameter im Überblick.

expressionErforderlich

The value to evaluate.

Beispiel: A2
val1Erforderlich

First value to test for equality.

Beispiel: 1
result1Erforderlich

Output returned if expression matches val1.

Beispiel: "Sunday"

Praxisbeispiel.

Schritt-für-Schritt-Szenario

Day Number to Name Mapping

Convert numeric day codes into weekday names.

Day CodeWeekday Name
2—
1—
3—
Eingesetzte Formel
=SWITCH(A2, 1, "Sunday", 2, "Monday", 3, "Tuesday", "Other")
Erwartetes Ergebnis::Monday

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

Passen Sie die Eingabefelder an, um eine fertige Formel für Ihre Tabelle zu kopieren.

Generated FormulaKopierbereit

Ergebniseigenschaften.

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

Ausgabebeispiel::Monday
Datentyp::Text

Empfohlene Vorgehensweise

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

Typische Fehlerquellen

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

Kompatibilität nach Versionen.

Geprüft auf Basis der offiziellen Tabellenkalkulations-Engines von Microsoft und Google.

Excel✓
Unterstützt
Excel 365✓
Unterstützt
Excel 2021✓
Unterstützt
Excel 2019✓
Unterstützt
Google Sheets✓
Unterstützt
Excel-Versionsverfügbarkeit

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

Hinweise zu Google Tabellen

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

Häufig gestellte Fragen.

Technische Q&A
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.