The SWITCH function is a cleaner alternative to nested IF statements when you need to compare one value against multiple possible matches.
ให้ AI ทำให้Select the target cell
Click on the cell where you want the result of the SWITCH function to appear.
Enter the SWITCH formula
Type =SWITCH(expression, value1, result1, [value2, result2], ..., [default]) and press Enter.
Define your cases
Replace 'expression' with the cell reference, list your value-result pairs, and optionally add a default value if no match is found.
=SWITCH(A1, 1, "Low", 2, "Medium", 3, "High", "Unknown")SWITCH compares one expression against multiple values, while IFS evaluates multiple logical conditions.