TopicsCheat sheetLessons
Lurndo › Excel › IFS

Learning Excel: IFS

More than two choices

The summer pass gets three prices: one for children, one for seniors from 65 and one for everyone else. "But IF only chooses between two," sighs Dave. Not if you nest them.

IF inside IF

The third argument of IF can itself be another IF. That way you test one thing after the other: first whether someone is a child, and if not, whether they're a senior.

=IF(B2<12,"child",IF(B2>=65,"senior","adult")) gives three possible outcomes. Count the brackets: each IF closes its own bracket.

F2
fx

=IF(B2<12,"child",IF(B2>=65,"senior","adult"))

ABCDEFG
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00child
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12

IFS

With lots of choices, that turns into a tangle of brackets. IFS puts them in a row: a test, an outcome, a test, an outcome…

=IFS(B2<12,"child",B2>=65,"senior",TRUE,"adult") does the same. Excel takes the first test that is true. The last test is simply TRUE: it's always true, so it catches everyone else.

Try it yourself

In F2, give each member their category: child (under 12), senior (65 or over) or adult. Fill down to F11.

ABCDEFG
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12
F2

Ready for more?

The full lesson has 5 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson
← PreviousAND, OR and NOTNext →Empty cells and IS functions

SQL

  • Topics
  • All lessons
  • Cheat sheet

Excel

  • Topics
  • All lessons
  • Shortcuts

HTML & CSS

  • About the course
  • All lessons

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Privacy
Nederlands