IFS(test1, value1, [test2, value2], …) chooses the value paired with the first true test.
Order matters: put more specific or higher-priority conditions first. Microsoft documents up to
127 condition/value pairs.
There is no separate default argument. A final TRUE, fallback pair supplies a default;
without any true test, the result is #N/A.
For example, =IFS(85>=90,"A",85>=80,"B",TRUE,"C") selects "B".
Try it
Start with the example's first true condition, then make it false to reach the fallback. Remove
the final TRUE pair to see the unmatched case. Keep the condition/value pairs balanced.
Quirks
Microsoft documents #VALUE! if an evaluated condition cannot resolve to TRUE or FALSE, and an
entry-time error message if a condition has no paired value. Those are distinct from an unmatched
but otherwise valid call returning #N/A.
The selected value can retain its reference identity. On the recorded build,
ISBLANK(IFS(TRUE,Data!Z1)) returns TRUE when that cell is empty. Converting every selected
reference to a number would lose this behaviour.
Later arrays do not necessarily enlarge the result. The recorded
IFS(TRUE,1,{FALSE,TRUE},{2,3}) returns one 1. This observation is about the selected result and
shape; it does not establish that every unselected expression avoids evaluation. Do not infer a
general short-circuit guarantee from the phrase “first true condition”.
IFS and SWITCH pass on the selected value whole, and later arrays do not lift the call
Once a scalar test selects a result, array arguments after it have no effect on the shape: IFS(TRUE,1,{FALSE,TRUE},{2,3}) and SWITCH(2,2,1,{1,2},3) each return one 1, not an array, and SWITCH("A","a",1,{"A","A"},2) returns 1 because the match ignores case. The selected value itself is passed on as it is. A selected reference stays a reference: ISBLANK(IFS(TRUE,Data!Z1)) is TRUE over an empty cell. A selected LAMBDA shows as #CALC! in the cell, IFS(TRUE,LAMBDA(xx,xx)), and a selected array of LAMBDAs as #CALC! in each cell. A test that is not TRUE or FALSE gives #VALUE! in the shape of its result: IFS("2",{"hit","hit"}) is {#VALUE!,#VALUE!}. A direct error as the SWITCH expression stays one error: SWITCH(#VALUE!,1,{1,2},0) is #VALUE!.
Formula
Excel
Mathematical value
=IFS(TRUE,1,{FALSE,TRUE},{2,3}) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
1 0x3ff0000000000000
—
=SWITCH(2,2,1,{1,2},3) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
1 0x3ff0000000000000
—
=SWITCH("A","a",1,{"A","A"},2) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
1 0x3ff0000000000000
—
=ISBLANK(IFS(TRUE,Data!Z1)) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Number supplied through a cell.
Data!Z1: (empty cell)
TRUE
—
=ISBLANK(SWITCH(1,1,Data!Z1)) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Number supplied through a cell.
Data!Z1: (empty cell)
TRUE
—
=IFS(TRUE,LAMBDA(xx,xx)) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
#CALC!
—
=SWITCH(1,1,LAMBDA(xx,xx)) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
#CALC!
—
=IFS(TRUE,HSTACK(LAMBDA(xx,xx),LAMBDA(xx,xx))) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
{#CALC!,#CALC!}
—
=IFS("2",{"hit","hit"}) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
{#VALUE!,#VALUE!}
—
=SWITCH(#VALUE!,1,{1,2},0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Represent the condition/value pairs explicitly and reject unpaired syntax at the formula
boundary. Determine the first matching condition according to Excel's logical coercion and
error rules, then return its corresponding value with its reference or callable identity intact.
Treat argument evaluation policy and result selection as separate design choices. Test an
unselected error, volatile function, recursive lambda and array independently before replacing
IFS with a chain of lazy IF operations. Selecting the same visible value does not prove the
same evaluation behaviour.
For array inputs, measure which conditions establish the output shape and when selection stops
that process. Apply errors per output coordinate where the measured rule calls for it. A blanket
broadcast over every argument contradicts the scalar-selection example above.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
/// The first true IFS condition. Shape admission and selection share logical coercion;/// the kernel validates pair structure before using the selected result index.fnifs_index(site: &Site<'_>, arguments: &[CalcValue]) -> Step<Option<usize>> {
for pair in (0..arguments.len()).step_by(2) {
ifflag(site, arguments, pair)? {
returnOk(Some(pair + 1));
}
}
Ok(None)
}
No implementation has been published with a Handbook test suite for this function.
Version differences
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
Excel 16.0 build
Platform and CPU
Captured inputs
20430
Windows, 64-bit, CPU not recorded
1,212
The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.
Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
=IFS(TRUE,1,{FALSE,TRUE},{2,3}) returned 1 (0x3ff0000000000000). =ISBLANK(IFS(TRUE,Data!Z1)) returned TRUE. 3 further recorded controls are attached. Inputs were supplied through cells using Value2, formula literals. These are controls from this environment, not a same-input comparison with another build.
1,212 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.
Alternatives
Use nested IF when its branch evaluation behaviour is required. Use
SWITCH when comparing one expression with several candidate values. Use a
lookup table when the conditions encode a growing data table. SUMIFS and COUNTIFS aggregate
matching cells; they do not select a single branch.