Logical · flat multi-condition branching · Nov 2026

The IFS function,
ordered & explained.

Syntax, a live grading playground, the first-TRUE-wins order rule, the #N/A default trap and its TRUE() fix, and a sourced error library: branch across many conditions without a nested-IF pyramid.

D1
fx
=IFS(B2>=90, "A", B2>=60, "B", TRUE(), "C")
0
max condition pairs
0
sourced errors fixed
0
platforms checked
// 01 — Anatomy

How IFS works

IFS checks conditions in order and returns the value paired with the first TRUE one — a flat replacement for a pyramid of nested IFs. Pairs are evaluated left to right; the first match wins and the rest are ignored.

=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], …)
logical_test1…NEach a condition that resolves to TRUE/FALSE: B2>=90, AND(...), ISNUMBER(...). Up to 127 tests.
value_if_true1…NReturned when its paired test is the first TRUE one. A value, text, reference, or formula.
TRUE(), defaultOptional catch-all final pair. Without it, no match returns #N/A — IFS has no built-in else.
// 02 — The order gallery

How IFS actually decides

Many conditions, one winner: IFS returns the value for the first TRUE test. The gallery below was measured live in the HyperFormula engine — load any row into the playground to reproduce it.

First TRUE wins — order matters

scorehigh→low orderresult
92>=90,>=60,TRUE()"A"
74>=90,>=60,TRUE()"B"
58>=90,>=60,TRUE()"C"
92>=60,>=90 (low first)"B" ✗

Measured: with the low threshold listed first, a 92 matches >=60 and returns "B" — the >=90 band is never reached. List bands high→low.

The #N/A default trap

IFS has no built-in else. When every condition is FALSE it returns #N/A. A final TRUE(),"default" pair is the catch-all.

=IFS(B6>=90,"A",B6>=60,"B")#N/A
=IFS(B6>=90,"A",B6>=60,"B",TRUE(),"C")"C"

Both measured on a score of 50. The only difference is the TRUE() tail — that one pair turns an error into a clean default.

IFS vs nested IF vs SWITCH

IFSNested IFSWITCH
Max127 pairs64 levels126 values
Shapeflatpyramidflat
Defaultadd TRUE()built-inbuilt-in
Best forrange bands1–2 branchesexact match

Rule of thumb: ≤2 branches → IF; 3+ ordered range bands → IFS with a TRUE() tail; exact-value matching → SWITCH.

// 03 — Try it live

Interactive IFS playground

Edit the score data or type any formula — the HyperFormula engine evaluates it instantly. Load a preset to see the order trap, the #N/A default, AND between-ranges and the text-threshold bug in action.

A1Sample data — click any cell to edit, the formula re-evaluates live
Result
—
✓ readyHyperFormula 3.5
// 04 — Error library

The real-world error library

10 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.

// 05 — Cross-platform

Where IFS works

IFS is modern (Excel 2019+/365). Older Excel returns #NAME? — here's where it lands across eight platforms and the nested-IF fallback.

PlatformSupportNotesGotcha
✓ Supported full IFS◐ Partial works with caveatsCompiled from public docs · verify against your build
// Go deeper

Master the logical family

IFS is the flat-branching workhorse. The full course walks the decision toolkit end to end — IF & SWITCH, AND/OR/XOR, the IS* tests, and how to compose them with lookups without the order, default and blank-cell traps.

  • IF · IFS · SWITCH — choosing the right branch tool
  • AND / OR / XOR / NOT — combining conditions safely
  • ISBLANK / ISERROR / ISNUMBER — bulletproof tests
  • Composing IFS with VLOOKUP / XLOOKUP for real workflows
Free while in beta
Browse the function library

No account needed. Every page has a live playground.

// 07 — FAQ

Frequently asked