IFS Function in Excel: Syntax and Examples

By Dr. Zubair Khalid, DVM, MS, PhD ·

IFS Function in Excel: Syntax and Examples

The IFS function in Excel tests several conditions in order and returns the result for the first one that is TRUE. It replaces long chains of nested IF functions with a single, readable formula. You write condition and result pairs, and Excel stops at the first match.

Quick Answer

  • IFS checks conditions left to right and returns the value paired with the first TRUE condition.
  • Syntax: =IFS(condition1, value1, condition2, value2, ...).
  • It replaces nested IFs, so =IFS(B2>=90,"A",B2>=80,"B",TRUE,"F") does the work of three stacked IFs.
  • If no condition is TRUE and you did not add a final TRUE pair, IFS returns #N/A.
  • Combine it with AND or OR inside a condition to test several things at once, such as =IFS(AND(B2>=70,C2="Yes"),"Pass",TRUE,"Review").

Syntax

IFS takes pairs of arguments. Each condition is followed by the value to return when that condition is TRUE.

ArgumentRequired?Meaning
condition1YesA logical test that evaluates to TRUE or FALSE, such as B2>=90.
value1YesThe result returned when condition1 is TRUE. Can be text, a number, a cell reference, or another formula.
condition2NoThe next logical test, evaluated only if condition1 is FALSE.
value2NoThe result returned when condition2 is TRUE.
...NoAdditional condition and value pairs, up to 127 pairs in total.

The function needs at least one condition and one value. Arguments must come in pairs, so an odd number of arguments triggers an error.

How It Works

Excel evaluates the conditions in the order you write them. The moment one condition is TRUE, IFS returns its paired value and ignores everything after it. This short-circuit behavior matters because it lets you order conditions from most specific to least specific.

Consider a grading rule. You want an A for 90 or above, a B for 80 or above, a C for 70 or above, and an F for anything lower. Written as nested IFs, the formula grows one level deeper for each band:

=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))

Each new band adds another closing parenthesis, and matching them by eye gets harder as the list grows [1]. The IFS version flattens the same logic into one level:

=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")

The final pair TRUE,"F" acts as a catch-all. Because TRUE is always TRUE, it catches every score that failed the earlier tests. Without it, a score of 65 would return #N/A instead of a grade.

Order is everything. If you put B2>=70,"C" before B2>=90,"A", a score of 95 would match the 70 test first and return C. Always place the strictest condition first.

Worked Example

The table below grades ten students. Column B holds each score, column C uses IFS to assign a letter grade, and column D uses a plain IF to mark Pass or Fail at a threshold of 70.

RowA (Student)B (Score)C (Grade)D (Status)
1StudentScoreGradeStatus
2Ana78=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F") -> displays C=IF(B2>=70,"Pass","Fail") -> displays Pass
3Ben92=IFS(B3>=90,"A",B3>=80,"B",B3>=70,"C",TRUE,"F") -> displays A=IF(B3>=70,"Pass","Fail") -> displays Pass
4Cara65=IFS(B4>=90,"A",B4>=80,"B",B4>=70,"C",TRUE,"F") -> displays F=IF(B4>=70,"Pass","Fail") -> displays Fail
5Dan85=IFS(B5>=90,"A",B5>=80,"B",B5>=70,"C",TRUE,"F") -> displays B=IF(B5>=70,"Pass","Fail") -> displays Pass
6Eve70=IFS(B6>=90,"A",B6>=80,"B",B6>=70,"C",TRUE,"F") -> displays C=IF(B6>=70,"Pass","Fail") -> displays Pass
7Finn55=IFS(B7>=90,"A",B7>=80,"B",B7>=70,"C",TRUE,"F") -> displays F=IF(B7>=70,"Pass","Fail") -> displays Fail
8Gia95=IFS(B8>=90,"A",B8>=80,"B",B8>=70,"C",TRUE,"F") -> displays A=IF(B8>=70,"Pass","Fail") -> displays Pass
9Hugo82=IFS(B9>=90,"A",B9>=80,"B",B9>=70,"C",TRUE,"F") -> displays B=IF(B9>=70,"Pass","Fail") -> displays Pass
10Ivy60=IFS(B10>=90,"A",B10>=80,"B",B10>=70,"C",TRUE,"F") -> displays F=IF(B10>=70,"Pass","Fail") -> displays Fail
11Jax88=IFS(B11>=90,"A",B11>=80,"B",B11>=70,"C",TRUE,"F") -> displays B=IF(B11>=70,"Pass","Fail") -> displays Pass

Walking through a few rows shows the short-circuit rule in action. Ana scores 78, which fails the 90 and 80 tests but passes the 70 test, so the formula returns C. Ben scores 92, which passes the very first test, so IFS returns A and never looks at the rest. Cara scores 65 and fails every threshold, so the TRUE catch-all returns F. Eve scores exactly 70, and because the test is >=70, she lands in the C band.

More Examples

Combining IFS with AND. Use AND when every condition in a test must hold. Suppose a student passes only when the score is at least 70 and attendance is marked "Yes" in column C.

=IFS(AND(B2>=70,C2="Yes"),"Pass",TRUE,"Review")

AND returns TRUE only when both parts are TRUE. If either fails, the formula falls through to the catch-all.

Combining IFS with OR. Use OR when any one condition is enough. This flags a student for support if the score is below 70 or attendance is "No".

=IFS(OR(B2<70,C2="No"),"Flag",TRUE,"OK")

OR returns TRUE as soon as one part is TRUE, so a single failing condition triggers the flag.

Mixing AND and OR. You can nest one inside the other for compound rules. This returns "Honors" for a score of 90 or above with attendance "Yes", "Pass" for a score of 70 or above, and "Fail" otherwise.

=IFS(AND(B2>=90,C2="Yes"),"Honors",B2>=70,"Pass",TRUE,"Fail")

Text categories. IFS is not limited to numbers. This assigns a shipping tier from a region code in column A.

=IFS(A2="NA","Standard",A2="EU","Express",A2="APAC","Priority",TRUE,"Check code")

If you are still building up from single-condition logic, the step-by-step guide to the IF function covers the foundation that IFS extends. For a two-way test with a single condition, a plain IF is often all you need.

Errors and How to Fix Them

ErrorCauseFix
#N/ANo condition was TRUE and there is no catch-all pair.Add a final TRUE, value pair to handle the leftover cases.
#N/AA condition references text that does not match, such as a typo in a region code.Check the spelling of the compared text and look for extra spaces.
#VALUE!A condition returns something other than TRUE or FALSE, such as text or a number.Make sure every condition is a logical test such as B2>=90.
Wrong resultConditions are ordered from least to most strict.Reorder so the strictest condition comes first.
#NAME?The function name is misspelled or the version does not support IFS.Check the spelling and confirm your Excel version includes IFS.

Common Mistakes

  • Leaving out the catch-all. Without a final TRUE pair, any value that fails every test returns #N/A. Add TRUE, "F" or a similar default to close the gap.
  • Ordering conditions loosely. IFS stops at the first TRUE, so a broad test placed early swallows the specific ones. Put the narrowest condition first.
  • Forgetting that AND and OR return a single TRUE or FALSE. Writing AND(B2>=70, C2="Yes") as one condition is correct. Splitting it into two separate IFS conditions changes the logic entirely.
  • Mixing up AND and OR. AND needs every part to be TRUE, OR needs just one. Pick the one that matches the rule you are describing.
  • Using IFS where a lookup fits better. For a long list of exact matches, a lookup table with VLOOKUP or XLOOKUP is easier to maintain than dozens of condition pairs. The SUMIF and SUMIFS guide shows how conditional aggregation handles grouped totals.
  • Assuming text tests are case-sensitive. A2="na" matches "NA" because the = operator ignores case. Use EXACT(A2,"NA") as the condition when case must match.

Limitations

IFS returns the first match and stops, so it cannot collect several results at once. If you need every matching value, not just the first, you need a different approach such as filtering or an array formula. IFS also cannot sum or count matches, it only returns one value per cell.

Very long IFS formulas become hard to audit. When the rules change often, a lookup table is easier to update because the logic lives in cells you can edit without touching the formula. IFS is also unavailable in older Excel versions, so a workbook built with it may show errors when opened elsewhere. If you need to build references dynamically, functions like INDIRECT can help, but they add their own fragility.

Frequently Asked Questions

What is the difference between IFS and nested IF?

Nested IF puts one IF inside another, so each added condition deepens the nesting and adds another closing parenthesis. IFS lists all condition and value pairs side by side at one level, which is easier to read and edit. Both return the first matching result, so the logic is the same, only the structure differs.

Does the IFS function work with AND and OR?

Yes. You place AND or OR inside a condition, so =IFS(AND(B2>=70,C2="Yes"),"Pass",TRUE,"Review") tests two things at once. AND requires all parts to be TRUE, while OR requires at least one. The result of the AND or OR becomes the condition IFS evaluates.

Why does my IFS formula return #N/A?

The most common cause is that no condition was TRUE and you did not include a catch-all pair. Adding TRUE, value as the final pair fixes it. A second cause is a text comparison that does not match because of a typo or an extra space.

How many conditions can IFS handle?

IFS accepts up to 127 condition and value pairs. In practice, formulas with more than a handful of pairs are hard to read and maintain. If you approach that many rules, a lookup table is usually the better design.

Can I use IFS in Google Sheets?

Google Sheets includes an IFS function with the same condition and value pair structure. The syntax carries over, so a formula written in Excel usually works in Sheets with little or no change. Check the Google Sheets IF function guide for the single-condition version and how it compares.

References

  1. Altman DG, Bland JM (2011). Brackets (parentheses) in formulas. BMJ

Further Reading

Related Articles