Formulas and Functions Help
- Welcome
-
- ACCRINT
- ACCRINTM
- BONDDURATION
- BONDMDURATION
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNUM
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENCYCODE
- CURRENCYCONVERT
- CURRENCYH
- DB
- DDB
- DISC
- EFFECT
- FV
- INTRATE
- IPMT
- IRR
- ISPMT
- MIRR
- NOMINAL
- NPER
- NPV
- PMT
- PPMT
- PRICE
- PRICEDISC
- PRICEMAT
- PV
- RATE
- RECEIVED
- SLN
- STOCK
- STOCKH
- SYD
- VDB
- XIRR
- XNPV
- YIELD
- YIELDDISC
- YIELDMAT
-
- AVEDEV
- AVERAGE
- AVERAGEA
- AVERAGEIF
- AVERAGEIFS
- BETADIST
- BETAINV
- BINOMDIST
- CHIDIST
- CHIINV
- CHITEST
- CONFIDENCE
- CORREL
- COUNT
- COUNTA
- COUNTBLANK
- COUNTIF
- COUNTIFS
- COVAR
- CRITBINOM
- DEVSQ
- EXPONDIST
- FDIST
- FINV
- FORECAST
- FREQUENCY
- GAMMADIST
- GAMMAINV
- GAMMALN
- GEOMEAN
- HARMEAN
- INTERCEPT
- LARGE
- LINEST
- LOGINV
- LOGNORMDIST
- MAX
- MAXA
- MAXIFS
- MEDIAN
- MIN
- MINA
- MINIFS
- MODE
- NEGBINOMDIST
- NORMDIST
- NORMINV
- NORMSDIST
- NORMSINV
- PERCENTILE
- PERCENTRANK
- PERMUT
- POISSON
- PROB
- QUARTILE
- RANK
- SLOPE
- SMALL
- STANDARDIZE
- STDEV
- STDEVA
- STDEVP
- STDEVPA
- TDIST
- TINV
- TTEST
- VAR
- VARA
- VARP
- VARPA
- WEIBULL
- ZTEST
- Copyright
![](https://help.apple.com/assets/6467B9B3CF36103D3A318861/6467B9B8CF36103D3A318879/en_US/784be3dfed809d4b6bb7cc427d8c5f01.png)
SWITCH
The SWITCH function evaluates a value against a list, and returns a result that corresponds with either the first matching value or an optional value if there is no match.
SWITCH(expression, switch-value, if-match, [default or switch-value…], [if-match…])
expression: The list of values you want to check for a match.
switch-value: The first value to compare against expression.
if-match: The value to return if switch-value matches expression.
default or switch-value…: Optionally include the value that’s returned if there is no match for expression, or one or more additional values to compare.
if-match…: For every switch-value…, an additional if-match… must be included.
Notes
default must be the last argument in the function.
Examples |
---|
Given a table where A2=1, A3=0, and A4=-1: =SWITCH(A2,1,"Yes", "No") returns "Yes", as switch-value matched expression. =SWITCH(A3,1,"Yes", "No") returns "No", as there was no match for expression. =SWITCH(A3,1,"Yes",0, "Maybe","No") returns "Maybe", as there was a match for expression in switch-value…. =SWITCH(A4,1,"Yes",0, "Maybe","No") returns "No", as there was no match for expression in switch-value or switch-value…. |