Logical Functions: AND, OR, NOT, IFS, SWITCH and IFERROR

Make spreadsheet formulas that decide. Combine conditions with AND, OR and NOT, write correct tests on text, dates and empty cells, and sort values into bands with nested IF, IFS and SWITCH. Catch expected errors with IFERROR and IFNA while keeping real mistakes visible, and keep long formulas readable with line breaks, helper columns, LET and input cells. Examples use Excel and work the same way in Google Sheets unless a difference is noted.

IntermediateLesson 1 of 7 in Spreadsheet Formulas and Functions Course

What you will learn

  1. Write logical tests that check several conditions at once, reverse a condition, and use the combined result to make a decision in a formula.
    • Require all or any conditions with AND and OR
      Use AND when every condition must hold and OR when one is enough, and read the TRUE or FALSE result each returns.
    • Reverse and nest conditions with NOT and XOR
      Turn a condition around with NOT or <>, combine AND and OR in one test, and recognize the rare cases where exactly one condition must hold.
    • Make decisions with combined tests in IF
      Place AND, OR and NOT inside IF to return a label, a number or a calculation, and count how many conditions a row meets.
  2. Compare text and dates correctly, test whether cells are empty or hold the expected type of entry, and avoid the silent wrong answers these values can cause.
    • Test text values and empty cells
      Compare text exactly as intended, check for words inside longer text, and tell empty cells, empty-looking text and numbers stored as text apart.
    • Test dates and times
      Compare dates as the numbers spreadsheets store them as, build fixed and moving date limits with DATE and TODAY, and handle times correctly.
  3. Build formulas that return one of three or more results, in the right order, and choose the function that states the rule most clearly.
    • Build nested IF formulas
      Place one IF inside another to sort values into bands, order the tests so each value lands in the right band, and close every bracket.
    • Replace nested IF with IFS
      Write a multi-band rule as one flat list of test and result pairs, add a default with TRUE, and know what IFS returns when nothing matches.
    • Match exact values with SWITCH
      Translate codes and fixed values into results with SWITCH, add a default, and know when IFS or a lookup table is the better choice.
  4. Recognize the common error values, replace the errors you expect with a clear result, and keep unexpected errors visible so mistakes can still be found.
    • Catch errors with IFERROR
      Know what the common error values mean and use IFERROR to return a chosen result in place of any error.
    • Catch missing values with IFNA
      Use IFNA to handle the "not found" case alone, so that every other error still shows.
    • Prevent and expose errors instead of hiding them
      Test for the expected problem before it causes an error, keep unexpected errors visible, and see how a careless replacement value changes totals and averages.
  5. Lay out long formulas so others can follow them, keep rules in cells instead of inside formulas, choose the clearest function, and test every branch before relying on the result.
    • Lay out long formulas so they can be read
      Use line breaks, helper columns, LET and named cells to make a long logical formula easy to read, check and change.
    • Keep rules in cells and test every branch
      Put thresholds and settings in input cells, check that the formula is still right when copied, and test each branch, boundary and unusual entry before trusting the result.

Logical Functions study guide

5 chapters

1

Combine conditions with AND, OR and NOT

Workplace rules often depend on several facts at once: a score and attendance, a member status or an order total, or a completed check with no cancellation. Logical functions turn those rules into TRUE or FALSE results. Start with complete comparisons, group them to match the wording, and use IF when the decision needs a label or calculation. Counting successful tests also lets you express a rule such as “at least two of three.”

1.1 Require all or any conditions with AND and OR

A logical test asks a question that has a TRUE or FALSE answer. Combining tests lets one formula express a rule with several requirements.

Write each comparison in full

=B2>=60 checks whether B2 is at least 60. The operators are = for equal, <> for not equal, > for more than, < for less than, >= for at least, and <= for no more than. The equal sign at the start enters a formula; the comparison inside it produces the logical result. A cell can display TRUE or FALSE without IF.

A course requires an exam score of at least 60 and attendance of at least 80%. Here B2 holds the score and C2 holds attendance as the whole number 85 for 85%. Write =AND(B2>=60,C2>=80). If attendance is stored as the percentage 85%, use C2>=80% instead. The threshold and the stored value must use the same scale.

Choose all or any

AND returns TRUE only when every condition is TRUE. With B2 = 72 and C2 = 85, both comparisons pass. With B2 = 72 and C2 = 78, the attendance test fails, so AND returns FALSE.

OR returns TRUE when at least one condition is TRUE, including when both are TRUE. Shipping is free for members or orders of at least 100. With membership in B2 and total in C2, use =OR(B2="Yes",C2>=100). A nonmember ordering 120 qualifies through the total. A nonmember ordering 80 does not qualify.

First conditionSecond conditionANDOR
TRUETRUETRUETRUE
TRUEFALSEFALSETRUE
FALSETRUEFALSETRUE
FALSEFALSEFALSEFALSE

This truth table checks all four combinations. Three conditions have eight combinations. Excel accepts up to 255 conditions in AND or OR.

Keep the rule's boundaries

“At least 60” includes exactly 60, so use >=60, not >60. “Under 18” excludes 18. Translate these words before combining the tests. Also ask what one row represents: a single order cannot be in both March and April. To accept either month, its two month tests need OR even if someone describes the report as “March and April orders.”

Each argument must be a complete test. Write =OR(B2="North",B2="South"); the fragment "South" alone does not compare B2 with anything. In AND(B2>=60,C2>=80), both cell references are necessary.

Check ranges and errors

=AND(E2:G2) can combine checklist cells. In Excel, text and empty cells inside that range are ignored. TRUE, TRUE and an empty cell therefore give TRUE; an unfinished checklist can appear complete. Store unchecked items as FALSE. Numbers also count: 0 is FALSE and every nonzero number is TRUE. A range containing only text and empty cells returns #VALUE! because no usable logical values remain.

AND and OR evaluate all their arguments. They cannot protect an unsafe calculation by putting a FALSE test first: =AND(FALSE,NA()) still returns #N/A.

Key Takeaways

  • AND requires every test to be TRUE; OR requires at least one.
  • Write each comparison in full and include the boundary when the rule says “at least” or “no more than.”
  • Use a truth table to check all combinations of conditions.
  • In Excel range arguments, empty cells and text are ignored; use FALSE for unchecked items.
  • An error in an AND or OR argument can make the whole result an error.

1.2 Reverse and nest conditions with NOT and XOR

NOT reverses a logical result. Nesting functions lets you reverse or combine a whole group of tests while keeping the rule's alternatives clear.

Reverse one test or a group

NOT(TRUE) returns FALSE, and NOT(FALSE) returns TRUE. For a simple inequality, =B2<>"Cancelled" is a shorter way to write =NOT(B2="Cancelled"). Both accept every status except “Cancelled.”

NOT is especially useful around a combined test. =NOT(OR(B2="Cancelled",B2="Refunded")) first finds either excluded status, then reverses that answer. A status of “Open” gives FALSE inside OR and TRUE after NOT. You can also reverse a checking function: =NOT(ISBLANK(C2)) is TRUE when C2 contains something, including a formula whose result looks empty.

Group the rule before typing

Equipment may be rented by someone who is at least 18 and has completed the safety course, or by someone with a supervisor present. Let B2 hold age, C2 the course answer and D2 the supervisor answer, with “Yes” or “No” in the last two cells.

=OR(AND(B2>=18,C2="Yes"),D2="Yes")

Read the inner group first: age and course must both pass. That group is one alternative; a supervisor is the other. For age 16, course “Yes” and supervisor “Yes,” the inner AND is FALSE but the outer OR is TRUE.

Moving the parentheses changes the rule:

=AND(B2>=18,OR(C2="Yes",D2="Yes"))

Now everyone must be at least 18. The same 16-year-old gets FALSE. The function names are unchanged, but the outer function decides which conditions apply to the whole decision.

Read “neither” and “not both” carefully

To accept colors other than “Red” and “Blue,” use =AND(B2<>"Red",B2<>"Blue"). If B2 is “Red,” the first test is FALSE. The tempting OR version accepts “Red” because it is not “Blue,” and accepts “Blue” because it is not “Red.” It accepts every error-free single color value.

These relationships are De Morgan's laws:

  • NOT(AND(x,y)) equals OR(NOT(x),NOT(y)): at least one condition fails.
  • NOT(OR(x,y)) equals AND(NOT(x),NOT(y)): both conditions fail.

Here x and y stand for logical tests. Reversing a combined test changes AND to OR, or OR to AND, and reverses each part.

Check an interval or an exclusive choice

An inclusive interval needs two complete comparisons: =AND(B2>=10,B2<=20). Do not write =10<=B2<=20. Excel evaluates the first comparison to a logical value and then compares that value with 20; it does not interpret a chained interval.

XOR handles an exclusive choice between two conditions: =XOR(B2="Yes",C2="Yes") returns TRUE only when exactly one answer is “Yes.” Both “Yes” answers return FALSE. With more than two arguments, XOR checks whether an odd number are TRUE. Three TRUE arguments therefore return TRUE too; XOR is not an “exactly one” test for a longer checklist.

Key Takeaways

  • NOT reverses one logical value, including the result of a whole combined test.
  • The outer function and its parentheses determine how alternatives are grouped.
  • “Neither” needs both exclusions to hold; “not both” needs at least one failure.
  • Use two comparisons joined by AND for a between test.
  • With two arguments XOR means exactly one TRUE; with more arguments it means an odd number of TRUE values.
  • Use <> for a simple not-equal comparison.

1.3 Make decisions with combined tests in IF

A combined test produces a logical answer. IF uses that answer to choose a useful label, amount or calculation.

Put the rule in IF's first argument

The structure is IF(logical_test,value_if_true,value_if_false). A course needs a score of at least 60 and attendance of at least 80%. With attendance stored as a whole-number percentage, write:

=IF(AND(B2>=60,C2>=80),"Pass","Retake")

For score 72 and attendance 85, AND gives TRUE and IF returns “Pass.” Change attendance to 78 and AND gives FALSE, so IF returns “Retake.” Write and check the combined test by itself when building the decision; then place it inside IF.

Text results need straight double quotation marks. Numbers, cell references and the logical values TRUE and FALSE do not. The quoted value "TRUE" is text. In Excel a cell containing that text fails a comparison with the logical value TRUE, and AND or OR ignores it inside a range argument. Use "" when the chosen result should be empty-looking text.

Return a calculation

A 5% bonus applies to sales of at least 10,000 in the North region. B2 holds sales and C2 the region:

=IF(AND(B2>=10000,C2="North"),B2*5%,0)

For 12,000 in the North, both tests are TRUE and the result is 600. For 12,000 in the South, the region test is FALSE and the result is 0. The percentage belongs in the calculation, not in quotation marks; "B2*5%" would return those characters as text.

When the desired answer is already TRUE or FALSE, use the combined test directly. =AND(B2>=60,C2>=80) gives the same logical result as wrapping it in IF(...,TRUE,FALSE).

Count how many conditions hold

Arithmetic converts TRUE to 1 and FALSE to 0. Parentheses keep each comparison together:

=(B2>=60)+(C2>=80)+(D2="Yes")

For score 72, attendance 78 and D2 = “Yes,” the contributions are 1, 0 and 1, giving 2. To shortlist a row meeting at least two of the three requirements, compare the total with 2:

=IF((B2>=60)+(C2>=80)+(D2="Yes")>=2,"Shortlist","No")

OR alone would accept one success, and AND would demand all three. Counting expresses a middle requirement directly. Changing >=2 to =2 would reject rows that meet all three, so the comparison must match “at least.”

Multiplication works like AND: (B2>=60)*(C2>=80) is 1 only when both pass. A sum works like OR only after testing whether it is greater than 0; the raw sum may be 2 or more. A double minus converts a single test to a number: =--(B2>=60) gives 1 or 0.

Make numeric tests explicit

IF also accepts a number as its test: 0 is FALSE and any nonzero number is TRUE. That makes =IF(C2,"Has stock","Out of stock") accept negative stock. If available stock must be positive, write =IF(C2>0,"Has stock","Out of stock").

Key Takeaways

  • Put AND, OR or NOT in IF's logical-test argument to choose between results.
  • Quote text; leave calculations, numbers and logical values unquoted.
  • Add parenthesized comparisons to count conditions met, then compare the count with the required minimum.
  • Write a positive-stock test as C2>0; a nonzero test also accepts negative numbers.
2

Write logical tests with text, dates and empty cells

Two cells can look alike and hold different kinds of values. A blank display may contain a formula, a date may be imported as text, and a number may actually be a text string. These differences change logical decisions without always producing an error. Text and date tests work best when you check the stored value as well as its appearance, and choose endpoints that include exactly the intended days or times.

2.1 Test text values and empty cells

A formula can return a believable answer while checking the wrong kind of value. Text, spaces, empty cells and numbers stored as text need deliberate tests.

Compare the text you mean

=B2="Paid" ignores letter case in Excel and Google Sheets: “Paid,” “paid” and “PAID” all pass. Use =EXACT(B2,"Paid") when case matters. EXACT compares characters case-sensitively, so a lowercase product code can remain distinct from an uppercase one.

Spaces still matter in an ordinary comparison. “Paid ” has a trailing space and fails B2="Paid". =TRIM(B2)="Paid" removes ordinary leading and trailing spaces and reduces repeated inner spaces to one before comparison. This helps with imported labels; inspect unusual imported spacing if it remains unequal.

Search inside longer text

=B2="*Ltd" compares with the literal characters “*Ltd”; the equal operator does not treat the asterisk as a wildcard. For a character sequence inside text, use =ISNUMBER(SEARCH("ltd",B2)). SEARCH returns a numeric position when the sequence is present and #VALUE! when absent. ISNUMBER makes those results TRUE and FALSE. SEARCH ignores case; FIND is case-sensitive.

A sequence is not necessarily a whole word. “AltData” contains the sequence “ltd” across its letters, so that test returns TRUE. When the ending matters, compare the ending: =RIGHT(B2,4)=".pdf". To test an invoice prefix, use =LEFT(B2,3)="INV". The character count must match the text being tested.

Decide what “empty” means
B2 containsB2=""ISBLANK(B2)
Nothing at allTRUETRUE
A formula returning ""TRUEFALSE
One spaceFALSEFALSE

ISBLANK checks whether the cell itself is empty. A formula occupies the cell even when it displays nothing. Use B2="" when either kind of empty-looking result should count as missing. A space remains content under both tests.

A truly empty cell counts as 0 in a numeric comparison. That means =IF(B2<50,"Fail","Pass") labels a missing score “Fail.” Test missing input first:

=IF(B2="","",IF(B2<50,"Fail","Pass"))

With B2 empty, IF returns empty text. With B2 = 45, it reaches the second IF and returns “Fail.”

Check the input type

In Excel, the text “100” is different from the number 100. ISNUMBER(B2) returns FALSE for that text, even if the cell looks numeric. ISTEXT(B2) returns TRUE. Formatting a text value as a number does not by itself change its stored type.

Excel also ranks text above numbers in comparisons, so a score entry of “absent” can pass B2>=60. Protect a numeric rule with a type check:

=IF(ISNUMBER(B2),IF(B2>=60,"Pass","Fail"),"Check score")

The result is “Pass” for numeric 72, “Fail” for numeric 45, and “Check score” for an empty cell, “absent” or the text “100.”

Key Takeaways

  • Ordinary text equality ignores case; EXACT makes case significant.
  • SEARCH finds character sequences, and ISNUMBER converts its found/not-found result to a logical value.
  • Use LEFT or RIGHT when the beginning or ending is what matters.
  • ISBLANK rejects a cell containing a formula, even when the formula returns "".
  • A space is content, not an empty cell.
  • Check ISNUMBER before using a numeric threshold on imported or mixed-type entries.

2.2 Test dates and times

Dates are numbers with date formatting. A logical date test works reliably when both sides contain real dates and the limits match the days or times you want.

Build a real date

A serial number counts days in the spreadsheet's calendar system. In Excel's standard 1900 system and Google Sheets, January 1, 2026 is 46023 and March 5, 2026 is 46086. Later dates have larger values. =B2>=DATE(2026,1,1) therefore checks whether B2 is on or after January 1, 2026.

DATE takes year, month and day separately. It avoids the regional ambiguity of “03/04/2026,” which can mean March 4 or April 3. Use DATE(2026,3,4) for March 4. A comparison with "1/15/2026" compares with text, not a date value. In Excel that text ranks above numeric dates, so it gives the wrong ordering. Use DATE or a reference to a real date cell. DATEVALUE can convert recognized date text, but its interpretation depends on the text and regional settings.

Choose a fixed or moving limit

TODAY() returns the current date and changes when the sheet recalculates on a different day. With a due date in B2 and status in C2:

=IF(AND(B2<TODAY(),C2<>"Paid"),"Overdue","")

On November 10, 2026, an open invoice due November 3 is overdue: 46329 is less than 46336. The test excludes dates equal to today. To include them, the business rule would need <=.

An empty due date also compares as 0 and would be flagged as overdue. Add a missing-date check:

=IF(AND(B2<>"",B2<TODAY(),C2<>"Paid"),"Overdue","")

For imported dates, check ISNUMBER(B2). A date-looking string is text until converted. Guarding a numeric date test with a type check can expose an entry that needs correction.

Include the right days

For seven calendar days including today, use =AND(B2>=TODAY(),B2<TODAY()+7). Adding 7 adds seven days. The interval includes today and the following six dates, ending just before the start of the seventh day after today. <=TODAY()+7 would include an eighth calendar date.

For date-only entries in the first quarter of 2026, =AND(B2>=DATE(2026,1,1),B2<=DATE(2026,3,31)) works. A timestamp needs a different upper endpoint.

Allow for times inside dates

A time is a fraction of a day. At 14:30 the fraction is about 0.6041667, so March 5, 2026 at 14:30 is about 46086.604. It is larger than midnight on March 5 and does not equal DATE(2026,3,5).

A timestamp on March 31 after midnight also fails <=DATE(2026,3,31). Include the entire quarter with =AND(B2>=DATE(2026,1,1),B2<DATE(2026,4,1)). This includes every time before April 1 starts.

INT(B2)=DATE(2026,3,5) discards the time fraction for a day-only comparison. NOW() returns the current date and time; TODAY() returns today's midnight value. An appointment earlier this morning is less than NOW but not less than TODAY.

Key Takeaways

  • Compare dates with real date values, such as DATE results, not quoted date text.
  • TODAY gives a moving date limit; NOW includes the time.
  • Use an exclusive upper limit at the next midnight to include a whole final day of timestamps.
  • Check for missing and text dates before applying a date rule.
  • A seven-day window including today ends before TODAY()+7.
3

Choose between several outcomes with nested IF, IFS and SWITCH

Grades, delivery fees and category labels need more than a yes-or-no result. Nested IF, IFS and SWITCH each offer a way to choose among several outcomes. The shape of the rule decides which reads most clearly: ordered tests suit bands, while exact matches suit codes. Trace one value through the decision, supply a meaningful fallback, and test the cutoffs where two outcomes meet.

3.1 Build nested IF formulas

A nested IF chooses among more than two results by placing another IF inside a result argument. Follow the branch selected by each test to see which result a value receives.

Build a descending threshold chain

Grades are A for 90 or more, B for 80 to below 90, C for 70 to below 80, D for 60 to below 70, and F below 60. With the score in B2:

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

For 85, 85>=90 is FALSE, so calculation enters the second IF. 85>=80 is TRUE, so the result is “B.” For 45, every comparison is FALSE and the final fallback gives “F.” Four IF functions provide five possible results. In a chain, each added IF introduces one extra choice.

Order thresholds to match the comparison

With >=, put the highest threshold first. If B2>=60 came first, a score of 95 would receive “D” before the formula ever reached 90. This is a logic error: the spreadsheet returns a valid label, so no error value warns you.

The same grades can be written with < tests in ascending order:

=IF(B2<60,"F",IF(B2<70,"D",IF(B2<80,"C",IF(B2<90,"B","A"))))

Now a score of 85 fails the tests below 60, 70 and 80, then passes the test below 90. Both orderings work because the earlier tests remove parts of the number line before the next test is reached.

A later descending test such as B2>=80 already implies a score below 90, because the first test failed. Repeating an upper limit in that branch adds work. It can also introduce gaps: a band written as 80 through 89 leaves 89.5 uncovered when the next band starts at 90.

Check exact cutoffs and parentheses

A score of exactly 90 must receive “A.” >=90 includes it; >90 does not. For each cutoff, check the cutoff itself, one value just below and one just above. Also choose a normal value from every band.

Each IF opens a parenthesis that needs a closing partner. The grade chain has four IFs and ends with four closing parentheses. Excel colors matching pairs while you edit. It supports up to 64 nested function levels, but each extra level makes the path harder to check.

Branch on two different rules

Nesting can occur in both result arguments. Members get 15% off orders of at least 100 and 10% off smaller orders. Other customers get 5% off orders of at least 100 and no discount otherwise:

=IF(B2="Yes",IF(C2>=100,15%,10%),IF(C2>=100,5%,0))

Here B2 is membership and C2 is the total. For “No” and 150, the outer IF chooses its false branch; that inner IF returns 5%.

For a simple weight band, use ascending upper limits. A parcel costs 4.50 up to 1 kg, 7.00 above 1 kg through 5 kg, and 12.00 above 5 kg: =IF(B2<=1,4.5,IF(B2<=5,7,12)). Weights of 1, 3.2 and 5.4 kg give 4.50, 7.00 and 12.00. Keep prices numeric and apply the desired number format to the result.

Key Takeaways

  • A nested IF evaluates the result branch selected by the outer test.
  • For lower-bound >= tests, check highest to lowest; for upper-bound < tests, check lowest to highest.
  • Earlier failed tests supply one side of a later band.
  • Test each cutoff and nearby values, including fractional inputs when they are allowed.
  • Close one pair of parentheses for each function call.
  • Both IF result arguments can contain further decisions.

3.2 Replace nested IF with IFS

IFS presents several decisions as a flat list of test/result pairs. It removes layers of nesting, while keeping the same need for a clear order and a final fallback.

Pair every test with its result

The pattern is IFS(test1,result1,test2,result2,...). For the grade rule:

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

IFS returns the result paired with the first TRUE test. With B2 = 85, both >=80 and lower thresholds are true, but the first matching pair gives “B.” With B2 = 60, the 60 pair gives “D.” Thresholds using >= must run from highest to lowest, just as in a nested IF chain.

The arguments come in pairs. =IFS(B2>=90,"A",B2>=80) leaves the last test without a result, so Excel refuses the incomplete formula. In Excel, IFS accepts up to 127 test/result pairs. A test must produce a usable logical result; a text value used as a test can produce #VALUE!.

Put the default last

IFS has no separate default argument. Without a TRUE test, it returns #N/A. Removing TRUE,"F" from the grade formula leaves a score of 45 with no matching pair.

The literal TRUE makes a final pair that always matches when no earlier pair was selected. Keep it last. If TRUE,"F" came first, every valid numeric score would return “F.” The default is a deliberate result for the remaining cases, not a repair for a wrong test order.

Convert a chain without changing the rule

Start with the parcel fee formula =IF(B2<=1,4.5,IF(B2<=5,7,12)). Copy each test and its true result into a pair, preserving order. Turn the last false result into a TRUE pair:

=IFS(B2<=1,4.5,B2<=5,7,TRUE,12)

At 1 kg the first pair gives 4.5. At 3.2 kg the first test fails and the second gives 7. At 5.4 kg both limits fail and the final pair gives 12. A single closing parenthesis ends IFS.

Use combined tests to explain the outcome

IFS can distinguish why a row did not pass. With a score in B2 and attendance entered as a whole-number percentage in C2:

=IFS(AND(B2>=60,C2>=80),"Pass",B2>=60,"Attendance too low",TRUE,"Score too low")

For 72 and 78, the combined pass test fails, but the score-only test succeeds. The result is “Attendance too low.” For score 50, both explicit tests fail and the default gives “Score too low.” The first pair must test the complete pass rule; otherwise a passing score could capture a row before attendance is considered.

IFS is supported in Excel for Microsoft 365, Excel 2019 and later, Excel for the web and Google Sheets. For a file that must work in Excel 2016 or earlier, use nested IF. Check the software version before replacing working formulas across a shared workbook.

Key Takeaways

  • IFS returns the result paired with the first TRUE test.
  • Each test needs its own result; preserve the threshold order when converting from nested IF.
  • A final TRUE/result pair supplies the default; no matching test gives #N/A.
  • Combined tests can distinguish several reasons for a decision.
  • Use nested IF when the workbook must support Excel 2016 or earlier.

3.3 Match exact values with SWITCH

SWITCH translates one value through a short list of exact matches. It is useful for codes, categories and results of a calculation when every match refers to the same expression.

Read the pairs after the expression

The pattern is SWITCH(expression,value1,result1,value2,result2,...,default). B2 holds a region code:

=SWITCH(B2,"N","North","S","South","E","East","W","West","Unknown")

If B2 is “S,” the expression matches the value “S” and returns “South.” If B2 is “X,” none of the listed codes matches, so the result is “Unknown.” The expression is written and evaluated once; each following pair supplies a match value and its result.

Excel accepts up to 126 value/result pairs. A short code list stays readable in a formula. When the list becomes long or changes often, store the code/result pairs in a table and use a lookup function so edits happen in cells.

Recognize the default

The default is a single final argument, without a matching value/result partner. After the expression, an odd number of arguments means the last argument is a default. In the region formula there are four pairs plus “Unknown.” Without that last argument, an unlisted code returns #N/A.

In IFS the fallback is a complete TRUE,result pair. In SWITCH it is just the result. Adding TRUE,"Unknown" after a code list would introduce another match pair rather than the intended single fallback.

Match values of the right type

SWITCH compares equality; it does not interpret a quoted operator as a rule. SWITCH(B2,">=90","A",...) tries to match B2 to the text “>=90.” Use IFS or nested IF for numeric thresholds.

Types also matter in Excel. If B2 contains the number 1, =SWITCH(B2,"1","Gold","2","Silver","Other") returns “Other.” The quoted match values are text. Write =SWITCH(B2,1,"Gold",2,"Silver","Other") to match numeric codes.

The pattern =SWITCH(TRUE,B2>=90,"A",B2>=80,"B","Other") does work: each comparison is tested for equality with TRUE. IFS expresses those threshold tests more directly.

Match a calculation's result

The expression can be calculated. With its default settings, WEEKDAY(B2) returns 1 for Sunday through 7 for Saturday. To label weekends:

=SWITCH(WEEKDAY(B2),1,"Weekend",7,"Weekend","Weekday")

March 5, 2026 is Thursday, so WEEKDAY returns 5. No weekend code matches, and the default returns “Weekday.” Using a different WEEKDAY numbering option would require changing the match values too.

DecisionClear function choice
One expression matches fixed codesSWITCH
Scores or weights fall into bandsIFS or nested IF
Different cells supply different testsIFS or nested IF
A long or frequently edited mappingA lookup table

SWITCH has the same version support as IFS: Excel 2019 and later, Microsoft 365, Excel for the web and Google Sheets. Older Excel versions do not support it.

Key Takeaways

  • SWITCH compares one expression with exact match values and returns the first matching result.
  • Use a single final argument as its default; without one an unmatched expression gives #N/A.
  • Match numeric codes with numbers and text codes with text.
  • Use IFS for thresholds and a lookup table for a long or changing mapping.
4

Handle errors with IFERROR and IFNA without hiding real problems

An error can describe an expected missing value or reveal a damaged formula. Replacing both with the same blank makes a sheet harder to trust. Error handling starts by identifying the failure and deciding what later formulas should receive. A direct IF test, IFNA and IFERROR offer different levels of control; the choice affects the displayed message, the errors still visible and the totals calculated from the results.

4.1 Catch errors with IFERROR

An error value tells you why a formula could not produce its normal result. IFERROR can replace that error with a chosen result, but the position of the wrapper and the replacement's type both matter.

Recognize the error first
ErrorCommon meaning
#DIV/0!Division by zero or an empty divisor
#N/AA needed value is unavailable, often because no match exists
#VALUE!The calculation received an unsuitable value type
#NAME?A function or name is unknown, often because of a typo
#REF!A reference points to cells that no longer exist
#NUM!A numeric calculation is invalid, such as a real square root of a negative number
#NULL!A space requests an intersection between ranges that do not intersect

Errors usually spread to formulas that depend on them. If a cell in D2:D20 contains #DIV/0!, =SUM(D2:D20) also returns #DIV/0!. Replacing a displayed error therefore changes what later formulas receive.

Wrap the complete calculation

IFERROR(value,value_if_error) returns the first value when it is not an error, or the second value when it is. Excel catches the seven error types above. Both arguments are required in Excel. Google Sheets lets you omit the second argument to display a blank for errors.

The cost in B2 is 18 and weight in C2 is 4.5 kg. =IFERROR(B2/C2,"No weight") calculates the price per kilogram as 4. If C2 is 0 or empty, the division fails and the result becomes “No weight.” That label describes the expected missing-divisor case; a different error inside the wrapped calculation would receive the same label.

The wrapper must include the division. =IFERROR(B2,0)/C2 only checks B2. It then divides by C2 outside IFERROR, so C2 = 0 still gives #DIV/0!. Write =IFERROR(B2/C2,0) if zero is the chosen replacement for errors in the whole quotient.

IFERROR is similar to IF(ISERROR(x),fallback,x), but it avoids writing x twice. It returns error-free results unchanged, including a genuine numeric 0.

Choose a useful replacement
ReplacementEffect
"No weight"Explains the expected problem in the displayed result
""Returns text that looks empty
0Supplies a numeric zero to later calculations

Zero is appropriate only when zero is the true intended result. A missing price is not automatically a free item. Empty text and a message can help a display, but they are not numbers: if D2 contains either "" or “No weight,” =D2*2 gives #VALUE! in Excel. A range-based SUM or AVERAGE handles text differently by ignoring it.

An empty cell supplied directly as either IFERROR argument is treated as empty text under Excel's documented behavior. Choose an explicit fallback so the formula states what the reader should receive, and check the original calculation before adding the wrapper.

Key Takeaways

  • Read the original error before choosing its replacement.
  • IFERROR replaces any of the common formula errors and leaves non-error results unchanged.
  • Wrap the entire calculation that may fail.
  • Choose a replacement that makes sense for later arithmetic as well as for display.
  • Excel requires an explicit fallback argument; Google Sheets permits an omitted one.

4.2 Catch missing values with IFNA

IFNA handles one particular error: #N/A. It is useful when an unavailable value is an expected outcome, while other errors need to stay visible.

Distinguish unavailable from invalid

#N/A means a needed value is not available. A lookup may find no matching code. IFS may have no TRUE test, or SWITCH may have no matching value and no default. NA() can also produce #N/A deliberately.

IFNA(value,value_if_na) replaces only that error. If the value is a normal number or text result, it is returned unchanged. If the value is #DIV/0!, #VALUE!, #REF! or another error, that error remains. IFNA is supported in current Excel versions and Google Sheets.

Label an unlisted code

Consider a short region list:

=IFNA(SWITCH(B2,"N","North","S","South"),"Code not listed")

With B2 = “N,” SWITCH returns “North,” so IFNA leaves that text unchanged. With B2 = “Q,” SWITCH has no match and no default. It returns #N/A, which IFNA replaces with “Code not listed.” In this small mapping, adding that text as the default argument of SWITCH would serve the same purpose.

Now imagine the function is mistyped as SWICH. Excel cannot recognize that name and produces #NAME?. IFNA leaves #NAME? visible. IFERROR would replace it with “Code not listed,” making a typing problem look like an ordinary unlisted code in every row.

Choose by the error you expect
FormulaWhen C2 is 0
=IFNA(B2/C2,0)Returns #DIV/0!
=IFERROR(B2/C2,0)Returns 0

Use it when the unavailable-value case has a clear meaning in the sheet. If a divisor can be zero, test that cause with IF or choose IFERROR when all errors truly need the same treatment.

Test for an error in a helper cell

ISNA(D2) returns TRUE only when D2 is #N/A. ISERROR(D2) returns TRUE for any error. These checking functions produce logical values that can drive another decision.

For example, =IF(ISNA(D2),"Check code","OK") labels a missing-code result. It does not detect every kind of problem: if D2 is #REF!, ISNA is FALSE and the label is “OK.” Use ISERROR when the helper column is meant to flag any formula error.

Key Takeaways

  • IFNA replaces only #N/A; every other error remains visible.
  • An unmatched SWITCH without a default and an IFS with no TRUE test can produce #N/A.
  • ISNA detects unavailable-value errors; ISERROR detects any formula error.

4.3 Prevent and expose errors instead of hiding them

Error handling is part of the meaning of a formula. A neat blank or zero can make an incomplete sheet look finished, so choose which failures to replace and which to expose.

Prevent the known cause

If a quotient cannot be calculated when the divisor is zero, test the divisor directly:

=IF(C2=0,"",B2/C2)

A truly empty C2 also compares as 0. In that case IF selects the empty-text result and does not evaluate the division. With C2 = 4 and B2 = 20, it reaches the division and returns 5. If B2 instead contains nonnumeric text, the division still reports an error. The formula handles the missing or zero divisor without hiding unrelated problems.

Compare that with =IFERROR(B2/C2,""). Both formulas display empty text for zero division. Only the broad IFERROR wrapper also conceals a broken reference, an unknown function name or an unsuitable value elsewhere in the wrapped calculation.

See what a replacement does to an average

Three unit costs are 10, an error, and 20. Replacing the error with 0 creates three numeric values: the total is 30 and AVERAGE divides by 3, giving 10. The zero now claims that the missing cost is known and equals zero.

Replacing the error with "" leaves two numbers in the range. AVERAGE ignores the text, divides 30 by 2 and gives 15, the mean of the known values. This still does not supply the missing cost. A complete three-item average remains unavailable until that cost is known.

The distinction also matters when the result is used directly. Empty text can be ignored by a range-based average but fail in multiplication. A fallback must suit both its meaning and the formulas that will read it.

Use the narrowest suitable handler
SituationSuitable approach
A known cause such as a zero divisorTest the cause with IF
An expected unavailable valueUse IFNA
Every error needs the same display treatmentUse IFERROR after checking the original formula

With an amount in B2 and a previously obtained rate in D2, =IFNA(B2*D2,"Missing rate") labels an unavailable rate. If B2 contains nonnumeric text and D2 contains a number, #VALUE! remains visible. The message does not replace that different problem.

Keep a way to find unfinished rows

Build and test the formula without a broad error wrapper first. Fix typos, references and value-type problems while their error values are visible. Then add handling for the expected cases.

Use messages that describe the issue, such as “Missing rate” or “Check code.” For a helper column that flags every error in D2, use =ISERROR(D2). Across a range, =SUMPRODUCT(--ISERROR(D2:D100)) counts error cells by converting TRUE/FALSE checks to 1 and 0. Keep that check pointed at results where errors are still visible; after IFERROR has changed an error into ordinary text, ISERROR cannot identify the original failure.

Key Takeaways

  • An IF test can prevent a known failure while leaving other failures visible.
  • Replacing a missing value with zero changes totals and the number of values in an average.
  • An average that ignores empty text describes the known numbers, not a complete data set.
  • Add error handling after testing the unwrapped formula.
  • Keep error checks on results before errors have been replaced by ordinary text.
5

Keep logical formulas readable and reliable

A useful formula must stay understandable when a colleague reads it, a setting changes or the formula is copied to another row. Layout, helper columns and names make its parts visible. Labeled input cells keep rules easy to update, and deliberate test cases reveal failures that ordinary data can miss. Software support and local formula syntax also matter when the workbook moves between users.

5.1 Lay out long formulas so they can be read

Readable formulas make the rule easier to check and change. You can improve layout, show parts in helper columns, or give repeated values names inside a formula.

Lay out test/result pairs

Spaces and line breaks between formula parts can improve layout without changing the result. In Excel for Windows, Alt+Enter inserts a line break while editing in the formula bar. Expand the bar so each pair can be seen:

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

Do not insert spaces inside a function name, a cell reference or a quoted label you want to keep unchanged. Layout separates parts; it does not change the conditions or results. This example gives “F” to every numeric score below 80 because those are the only bands it defines.

Show the parts in helper columns

A helper column calculates one part of a larger rule. For a score and attendance rule, put =B2>=60 in E2 under “Score OK” and =C2>=80 in F2 under “Attendance OK,” with attendance stored as a whole-number percentage. Then use =IF(AND(E2,F2),"Pass","Retake") for the decision.

A failed row now shows whether the score, attendance or both caused the result. You can filter the helper columns and check each calculation on its own. Give each helper a heading that describes what TRUE means.

Name values inside LET

LET(name1,value1,name2,value2,...,calculation) assigns local names, then evaluates the final calculation using them:

=LET(score,B2,attend,C2,IF(AND(score>=60,attend>=80),"Pass","Retake"))

The name score represents B2 and attend represents C2 only inside this formula. If a calculation such as B2*C2 appears several times, LET can name it once and reuse the result. This reduces repeated work as well as repeated text.

Choose names that start with a letter and do not conflict with Excel reference syntax. score and total_cost work; B2 and AB12 are cell references, and c conflicts with R1C1 reference notation. LET is available in Microsoft 365, Excel 2021 and later, and Google Sheets. Excel 2019 does not support it.

Name a fixed setting on the sheet

A named cell points to a worksheet setting, such as PassMark for the cell containing 60. Select the cell and enter its name in the Name Box, or use Formulas > Define Name. Use an absolute reference in the name's definition for a fixed setting. =IF(B2>=PassMark,"Pass","Fail") then states the rule in words, and copied formulas keep using that setting.

Keep simplification faithful

IFS often reads more clearly than a long IF chain, and SWITCH suits a code list. AND can combine two requirements in one IF without repeating the result. But evaluation behavior matters too: a nested IF can skip an unused branch, while AND evaluates every argument. If the score fails and the attendance cell contains an error, a nested score-first IF can return “Retake” without reading attendance; the AND version returns the error. Simplify after checking both the rule and the inputs.

Key Takeaways

  • Line breaks separate formula parts without changing their meaning.
  • Helper columns expose intermediate checks that can be inspected and filtered.
  • LET names values within one formula and can reuse a calculation once.
  • A named cell with an absolute definition keeps a fixed worksheet setting easy to read.
  • Check error behavior when replacing nested IF with AND.

5.2 Keep rules in cells and test every branch

A formula can be correct in one row and wrong after copying, or correct for ordinary values and wrong at a boundary. Reliable workbooks make settings visible and check those cases deliberately.

Put changeable rules in input cells

A hard-coded value is typed directly into the formula. If the pass mark is 60 in every row, changing the policy to 65 requires editing every formula. Instead, put the pass mark in a labeled setting cell such as F1.

Use =IF(B2>=$F$1,"Pass","Fail"). When copied down, B2 becomes B3 but $F$1 stays fixed. If you wrote F1, the copied formula would use F2. An empty F2 compares as zero, so the formula could pass every nonnegative score. A name such as PassMark, defined with an absolute reference to F1, can make the same rule easier to read.

Test results, boundaries and unusual entries

Write expected results beside your trial inputs before checking the formula. Include:

  • One ordinary input for every possible result.
  • Every cutoff itself and values just below and above it.
  • An empty cell and a wrong value type.
  • A copied row, to check that references move or stay fixed correctly.

For the grade rule, values such as 95, 90, 89, 85, 80, 79, 70, 69, 60, 59 and 45 exercise the bands. Add an empty score and “absent” to check input handling. If fractional scores are allowed, test a value such as 89.5 to expose gaps between integer-looking bands.

For combined conditions, use a truth table: two independent conditions have four TRUE/FALSE combinations and three have eight. A supervisor exception must work both when the other requirements pass and when they fail. Testing only one approved row cannot reveal a misplaced outer AND.

Inspect a formula's steps

In Excel for Windows, choose Formulas > Formula Auditing > Evaluate Formula. Each evaluation shows an intermediate value, helping you find the branch selected or the first unexpected result.

While editing in the formula bar, you can select a complete expression and press F9 to see its value. Press Esc afterward to keep the original formula; pressing Enter can save the calculated value in place of the expression. Use the tool to inspect the calculation, then correct the rule or reference that caused the problem.

Check who will open the workbook

IFS and SWITCH work in Excel 2019 and later, Microsoft 365, Excel for the web and Google Sheets. LET needs Excel 2021 and later, Microsoft 365 or Google Sheets. Unsupported functions can appear as #NAME? in older Excel. Use supported alternatives before sharing the file.

Formula language also affects typing. English formulas use IF, AND, TRUE and FALSE; translated Excel editions display localized names. Argument separators are commonly semicolons where a decimal comma is used. For example, Spanish Excel can display =SI(Y(B2>=60;C2>=80);"Pass";"Retake"). The quoted labels remain the text you entered. Excel translates function names when opening the workbook in another language, so users can work with their local names without rebuilding its logic.

Key Takeaways

  • Keep changeable thresholds in labeled cells and lock fixed references when copying.
  • Check every result, every boundary, missing inputs, wrong types and a copied row.
  • Use a truth table to exercise all combinations in a combined rule.
  • Evaluate Formula reveals intermediate steps; after an F9 inspection, press Esc to preserve the formula.
  • Confirm function support and local formula syntax for the people who will use the file.
  • Quoted result labels remain the text entered even when function names are translated.

Logical Functions examples

5 Walkthroughs

1

Build a decision from several conditions

12 steps
Translate an equipment-release rule, check its grouping and return a useful result.
  1. 1
    IntroductionTurn a rule into tests

    An equipment desk releases a kit when its inspection score is at least 70 and its checklist is complete. A supervisor can approve a kit as an exception. B2 holds the score, C2 holds “Yes” or “No” for the checklist, and D2 holds “Yes” or “No” for supervisor approval. We will turn the normal route into a combined test, add the exception, then return a release label.

  2. 2
    ExplanationWrite both requirements

    The normal route has two complete comparisons: B2>=70 and C2="Yes". “At least” includes exactly 70, so the first comparison needs >=. The second compares C2 with quoted text. Write the cell reference in each comparison; a fragment such as "Yes" on its own does not ask whether the checklist cell contains that answer.

  3. 3
    ExampleRequire both to pass

    Use =AND(B2>=70,C2="Yes") for the normal route. With score 74 and checklist “No,” the tests are TRUE and FALSE, so AND is FALSE. With score 70 and checklist “Yes,” both are TRUE and AND is TRUE. A normal release requires both requirements; OR would release the first kit through its score alone.

  4. 4
    ChallengeCheck a changed requirement

    A separate request is urgent if its priority in E2 is “High” or its wait in F2 is at least 5 days. Write the logical test. Would “Low” priority with a 5-day wait qualify?

    ---reveal---

    =OR(E2="High",F2>=5) returns TRUE for that request. The priority test fails, but the wait reaches the inclusive boundary. AND would demand both conditions and wrongly reject it.

  5. 5
    ExampleAdd the supervisor route

    Put the normal route inside OR: =OR(AND(B2>=70,C2="Yes"),D2="Yes"). With score 62, checklist “Yes” and supervisor “Yes,” the inner AND gives FALSE. The supervisor test gives TRUE, so OR gives TRUE. The outer OR makes supervisor approval a complete alternative to the normal route.

  6. 6
    Key InsightMove a parenthesis, change the rule

    Compare =AND(B2>=70,OR(C2="Yes",D2="Yes")). Its outer AND makes the score requirement apply to everyone. The kit scoring 62 now fails even with supervisor approval. Read the groups in words before typing: “score and checklist, or supervisor” differs from “score, and either checklist or supervisor.”

  7. 7
    ExplanationExclude two statuses

    A kit may also be blocked when its status in E2 is “Lost” or “Retired.” The acceptance test =NOT(OR(E2="Lost",E2="Retired")) reverses that blocked-status test. It is equivalent to =AND(E2<>"Lost",E2<>"Retired"). Both exclusions must hold. OR between the two not-equal tests would accept “Lost” because it is not “Retired.”

  8. 8
    ChallengeChoose an exclusive check

    A form has two contact choices in F2 and G2, each “Yes” or “No.” Exactly one must be “Yes.” Write the test and explain what happens if both are “Yes.”

    ---reveal---

    =XOR(F2="Yes",G2="Yes") returns FALSE when both are “Yes.” With two arguments, XOR accepts exactly one TRUE. If a third choice were added, XOR could also accept three TRUE values, so it would no longer express exactly one choice.

  9. 9
    ExampleReturn a label

    The release test can now drive IF: =IF(OR(AND(B2>=70,C2="Yes"),D2="Yes"),"Release","Hold"). For score 74, checklist “No” and supervisor “No,” both routes fail and the result is “Hold.” The words need quotation marks. If a TRUE/FALSE answer were all the desk needed, the OR expression could be used directly.

  10. 10
    ExplanationCount successful checks

    A review queue uses three checks: score at least 70, checklist “Yes” and supervisor “Yes.” =(B2>=70)+(C2="Yes")+(D2="Yes") counts them because arithmetic converts TRUE to 1 and FALSE to 0. Score 74, checklist “No” and supervisor “Yes” give 1 + 0 + 1, or 2. Compare the total with >=2 for an “at least two” rule.

  11. 11
    ChallengeKeep the exception and the output

    For the original desk rule, score is 68, checklist is “No” and supervisor is “Yes.” What label does the release formula return, and would replacing its outer OR with AND keep that result?

    ---reveal---

    It returns “Release”: supervisor approval satisfies the alternative route. Replacing the outer OR with AND would return “Hold,” because the normal-route group is FALSE. IF chooses the output after the grouped test decides the rule.

  12. 12
    RecapRead the decision from inside out

    Complete comparisons supply logical values. AND requires all of them; OR accepts any; NOT reverses a result. Parentheses decide which requirements form a group and which are alternatives. IF converts the final logical result into a label or calculation. When the rule asks for a minimum count of successes, add the parenthesized tests and compare that count with the minimum.

2

Check entries before deciding

11 steps
Distinguish text, empty results and timestamps so a status formula checks the intended values.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionA display is not the stored value
  2. 2
    ExampleChoose the text comparison
  3. 3
    ExplanationFind a sequence or an ending
  4. 4
    ExampleTell two blank displays apart
  5. 5
    ChallengeReject a text score
  6. 6
    ExplanationMake the limit a date value
  7. 7
    ExampleStart the month at midnight
  8. 8
    ExampleEnd before the next month
  9. 9
    ChallengeBuild a moving window
  10. 10
    ChallengeHandle a missing due date
  11. 11
    RecapChoose the test that fits the value
3

Choose an outcome and a clear formula

12 steps
Build weight bands, flatten them with IFS and translate fixed service codes with SWITCH.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionBands and codes need different decisions
  2. 2
    ExplanationWrite the bands with clear endpoints
  3. 3
    ExampleFollow a parcel into the second IF
  4. 4
    ChallengeTest both boundaries
  5. 5
    ExampleFlatten the same rule
  6. 6
    Key InsightA fallback does not fix ordering
  7. 7
    ChallengeFill the final pair
  8. 8
    ExplanationTranslate a fixed code
  9. 9
    ExampleMatch the value type
  10. 10
    ChallengeKeep thresholds as tests
  11. 11
    ConnectionChoose a form others can maintain
  12. 12
    RecapTrace the value to its outcome
4

Handle a missing result without hiding a broken formula

10 steps
Compare broad error handling, missing-value handling and a direct cause check.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionDecide what an error means
  2. 2
    ExampleRead the failed calculation
  3. 3
    ExampleWrap all of the quotient
  4. 4
    ChallengeFollow a message into arithmetic
  5. 5
    ExplanationCatch only an unavailable value
  6. 6
    ChallengeKeep a typo visible
  7. 7
    ExamplePrevent the known cause
  8. 8
    ExampleSee how a zero changes an average
  9. 9
    ChallengeChoose the narrow treatment
  10. 10
    RecapMatch the handler to the failure
5

Make a formula easy to update and test

11 steps
Refactor a release rule, lock its settings and check copied rows and boundaries.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionMake the rule visible
  2. 2
    ExampleShow intermediate checks
  3. 3
    ExplanationName values inside the formula
  4. 4
    ChallengeChoose where a name belongs
  5. 5
    ExampleCheck the copied reference
  6. 6
    ExplanationChoose tests before trusting labels
  7. 7
    TipInspect the intermediate value
  8. 8
    ChallengeFind the missing case
  9. 9
    ConnectionCheck the receiving app
  10. 10
    ChallengeRepair the rule and verify it
  11. 11
    RecapLeave a formula others can check

Logical Functions practice questions

40 Practice Questions in 4 sets

Set 1: Read tests and follow decisions10 Practice Questions

Question 1 of 10

A request is eligible when its score in B2 is at least 65 and its form in C2 is “Complete.” What logical formula expresses eligibility?
  1. =OR(B2>=65,C2="Complete")
  2. =AND(B2>=65,C2="Complete")
  3. =AND(B2>65,C2="Complete")
  4. =OR(B2>65,C2="Complete")
Show answerHide answer
Answer: B
Both requirements must hold, so AND joins the two complete comparisons. “At least 65” includes exactly 65 and needs >=65. OR would admit a request with an incomplete form whenever its score met the threshold, while >65 would reject a request exactly on the boundary.

Question 2 of 10

B2 holds one status. What test accepts every status except “Paused” and “Closed”?
  1. =OR(B2<>"Paused",B2<>"Closed")
  2. =AND(B2="Paused",B2="Closed")
  3. =NOT(AND(B2="Paused",B2="Closed"))
  4. =AND(B2<>"Paused",B2<>"Closed")
Show answerHide answer
Answer: D
The status must differ from both excluded labels, so both not-equal tests must be TRUE. OR between those tests accepts even “Paused,” because it differs from “Closed.” Reversing an AND of the two equalities has the same flaw: one status cannot equal both labels at once.

Question 3 of 10

B2 contains =IF(A2="","",A2) and currently displays nothing. What does =ISBLANK(B2) return?
  1. FALSE
  2. TRUE
  3. #VALUE!
  4. #N/A
Show answerHide answer
Answer: A
ISBLANK checks whether the cell itself contains nothing. B2 contains a formula, so the result is FALSE even though its displayed value is empty text. TRUE would be the result for a genuinely empty cell, or for the different test B2="" on this empty-text result.

Question 4 of 10

B2 contains May 31, 2026 at 16:00 as a real timestamp. What does =AND(B2>=DATE(2026,5,1),B2<DATE(2026,6,1)) return?
  1. FALSE
  2. #VALUE!
  3. TRUE
  4. #N/A
Show answerHide answer
Answer: C
The timestamp is on or after May 1 and before June 1 at midnight, so both tests are TRUE. Its time fraction does not put it into June. A May 31 upper limit using <=DATE(2026,5,31) would reject 16:00, but that is not the upper limit in this formula.

Question 5 of 10

B2 is 96. What result does =IF(B2>=50,"Basic",IF(B2>=80,"High","Low")) return?
  1. “High”
  2. “Low”
  3. “Basic”
  4. #N/A
Show answerHide answer
Answer: C
The outer test is already TRUE because 96 is at least 50, so the selected result is “Basic.” The inner IF is in the false branch and is not reached. Expecting “High” assumes the later, stronger threshold can override an earlier match; this formula never gives it that chance.

Question 6 of 10

B2 is 12. What does =IFS(B2>=30,"Large",B2>=20,"Medium") return?
  1. “Medium”
  2. #N/A
  3. FALSE
  4. 0
Show answerHide answer
Answer: B
Neither test is TRUE, and IFS has no separate default argument, so it returns #N/A. It does not use the last label merely because it is last. A final TRUE,"Small" pair would explicitly supply a result for values below 20 instead of leaving them unmatched.

Question 7 of 10

B2 is 32 and C2 is 0. What does =IFERROR(B2/C2,"Check mass") return?
  1. “Check mass”
  2. 0
  3. 32
  4. #DIV/0!
Show answerHide answer
Answer: A
The quotient produces #DIV/0!, and the complete quotient is inside IFERROR. IFERROR therefore returns the specified text “Check mass.” Zero is not an automatic fallback: it would appear only if 0 had been chosen as the second argument, which would also change the meaning of the result.

Question 8 of 10

B2 is 32 and C2 is 0. What does =IFNA(B2/C2,"Missing") return?
  1. “Missing”
  2. 0
  3. #N/A
  4. #DIV/0!
Show answerHide answer
Answer: D
Dividing by zero produces #DIV/0!. IFNA handles only #N/A, so this different error stays visible. “Missing” would be returned if the wrapped expression produced #N/A; treating IFNA as a general error catcher confuses it with the broader behavior of IFERROR.

Question 9 of 10

E2 and F2 contain logical TRUE; G2 is truly empty. What does =AND(E2:G2) return in Excel?
  1. FALSE
  2. TRUE
  3. 0
  4. #VALUE!
Show answerHide answer
Answer: B
Excel ignores empty cells in a range argument, leaving two TRUE values, so AND returns TRUE. FALSE would require a usable FALSE value such as an unchecked item stored as FALSE or numeric 0. #VALUE! applies when the range has no usable logical or numeric values at all.

Question 10 of 10

A decision must require the score to reach the pass mark in F1 and the form answer to be “Yes.” Copied row 3 uses =IF(OR(B3>=F2,C3="Yes"),"Accept","Review"). What repair to the row 2 source formula and test plan checks both the rule and copying?
  1. Use AND and $F$1; test both mixed cases.
  2. Use OR and $F$1; test both mixed cases.
  3. Use AND and F1; retest both matched cases.
  4. Use OR and F1; retest both matched cases.
Show answerHide answer
Answer: A
OR accepts a completed form even when its score comparison fails, so the two requirements need AND. The copied F2 reference shows that the shared setting must be locked as $F$1 in the source formula. Test both mixed cases after copying; fixing only the reference would still leave OR accepting a row that meets just one requirement.
Set 2: Apply boundaries and value types10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A row has B2 = 81, C2 = 67 and D2 = “Yes.” What does =IF((B2>=75)+(C2>=70)+(D2="Yes")>=2,"Review now","Wait") return?
  1. “Review now”
  2. “Wait”
  3. 2
  4. TRUE
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

B2 contains “brushwork.” What does =ISNUMBER(SEARCH("rush",B2)) return?
  1. FALSE
  2. #VALUE!
  3. “rush”
  4. TRUE
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A workbook repeats B2*C2 several times inside one formula. What feature can name and reuse that calculated value locally?
  1. A named input cell
  2. An absolute reference
  3. LET
  4. A number format
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A numeric timestamp column includes entries throughout September 2026. The report must accept every September timestamp, reject missing dates and reject text dates. What formula meets all three requirements?
  1. =AND(ISNUMBER(B2),B2>=DATE(2026,9,1),B2<=DATE(2026,9,30))
  2. =AND(ISNUMBER(B2),B2>=DATE(2026,9,1),B2<DATE(2026,10,1))
  3. =AND(B2<>"",B2>=DATE(2026,9,1),B2<=DATE(2026,10,1))
  4. =OR(ISNUMBER(B2),B2>=DATE(2026,9,1),B2<DATE(2026,10,1))
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A fee is 2 up to 3 kg, 5 above 3 kg through 8 kg, and 9 above 8 kg. What fee does =IF(B2<=3,2,IF(B2<=8,5,9)) give for 8 kg?
  1. 2
  2. 5
  3. 9
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

In Excel, B2 contains numeric 2. What does =SWITCH(B2,"1","First","2","Second","Other") return?
  1. “Second”
  2. “First”
  3. #N/A
  4. “Other”
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

B2 is 18 and C2 is 0. What does =IFERROR(B2,0)/C2 return?
  1. #DIV/0!
  2. 0
  3. 18
  4. #VALUE!
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A range should contain three costs: 12, an unavailable cost and 24. One sheet replaces the unavailable entry with 0; another replaces it with empty text. What are their AVERAGE results, and what can be concluded?
  1. 18 and 12; the first is the known-cost mean.
  2. 18 and 18; both recover the complete mean.
  3. 12 and 18; the second is the known-cost mean.
  4. 12 and 12; neither excludes the missing entry.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Which proposed LET name is valid in Excel: net_cost, B4, AB12 or c?
  1. B4
  2. AB12
  3. c
  4. net_cost
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Row 2 contains =IF(B2>=$H$1,"Accept","Review"). What formula appears when it is copied one row down?
  1. =IF(B3>=$H$2,"Accept","Review")
  2. =IF(B2>=$H$1,"Accept","Review")
  3. =IF(B3>=$H$1,"Accept","Review")
  4. =IF(B3>=H2,"Accept","Review")
Show answerHide answer

Save this lesson to see this answer.

Set 3: Diagnose grouped rules and hidden errors10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A deadline column may contain truly empty cells, text dates or real timestamps. Only valid timestamps earlier than the current instant should be labeled “Late.” Which test fits the requirement?
  1. =AND(B2<>"",B2<TODAY())
  2. =AND(ISNUMBER(B2),B2<TODAY())
  3. =AND(ISNUMBER(B2),B2<NOW())
  4. =OR(ISNUMBER(B2),B2<NOW())
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A request qualifies if it is marked urgent in B2, or if its score C2 is at least 80 and its form D2 is complete. Urgent requests can qualify with an incomplete form. What formula states the rule?
  1. =AND(OR(B2="Yes",C2>=80),D2="Complete")
  2. =AND(B2="Yes",OR(C2>=80,D2="Complete"))
  3. =OR(AND(B2="Yes",C2>=80),D2="Complete")
  4. =OR(B2="Yes",AND(C2>=80,D2="Complete"))
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Three checks are B2>=40, C2="Yes" and D2<>"Closed". A row should return “Select” when at least two checks pass, including rows where all three pass. What formula expresses that rule?
  1. =IF((B2>=40)+(C2="Yes")+(D2<>"Closed")=2,"Select","Skip")
  2. =IF((B2>=40)+(C2="Yes")+(D2<>"Closed")>=2,"Select","Skip")
  3. =IF(OR(B2>=40,C2="Yes",D2<>"Closed"),"Select","Skip")
  4. =IF(XOR(B2>=40,C2="Yes",D2<>"Closed"),"Select","Skip")
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

B2 contains “Approved ” with one ordinary trailing space. Which test returns TRUE after removing that space and also accepts lowercase “approved”?
  1. =TRIM(B2)="Approved"
  2. =EXACT(B2,"Approved")
  3. =B2="Approved"
  4. =ISBLANK(TRIM(B2))
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

B2 is 43. A formula is =IFS(TRUE,"Standard",B2>=40,"Priority"). What result appears, and what ordering change is needed if scores of at least 40 should be “Priority”?
  1. “Standard”; move the TRUE pair last.
  2. “Priority”; leave the TRUE pair first.
  3. “Standard”; change >=40 to >40.
  4. #N/A; add a second TRUE pair at the end.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

B2 contains the error #N/A. What does =IFNA(B2,"Not listed") return?
  1. #N/A
  2. FALSE
  3. 0
  4. “Not listed”
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

D2 contains an error. What is the key difference between =IFERROR(D2,0) and =IFERROR(D2,"") when those results enter an AVERAGE range?
  1. Both are counted as numeric zeros.
  2. Both are ignored as missing entries.
  3. Zero is counted; empty text is ignored.
  4. Empty text is counted; zero is ignored.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

D2 contains #REF!. What do =ISNA(D2) and =ISERROR(D2) return, in that order?
  1. TRUE and TRUE
  2. FALSE and TRUE
  3. FALSE and FALSE
  4. TRUE and FALSE
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A numeric amount in B2 is multiplied by a rate in D2. An unavailable rate should show “Missing rate,” but a broken reference or nonnumeric amount must still show its error. What handler fits?
  1. =IFNA(B2*D2,"Missing rate")
  2. =IFERROR(B2*D2,"Missing rate")
  3. =IF(ISERROR(B2*D2),"Missing rate",B2*D2)
  4. =IFERROR(IFNA(B2*D2,"Missing rate"),0)
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

An IFS formula checks score bands at 30 and 70, with >= comparisons. Which group best tests both boundaries?
  1. 20, 25, 35, 60, 75, 80
  2. 29, 31, 40, 50, 69, 71
  3. 30, 40, 50, 60, 70, 80
  4. 29, 30, 31, 69, 70, 71
Show answerHide answer

Save this lesson to see this answer.

Set 4: Repair formulas and judge their consequences10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

In Excel, E2 is logical FALSE and F2 is #N/A. What does =AND(E2,F2) return?
  1. #N/A
  2. FALSE
  3. TRUE
  4. #VALUE!
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A row is accepted when its value B2 is from 15 through 25 inclusive, or it has override “Yes” in C2. Rows labeled “Blocked” in D2 must always be rejected. What formula implements all three parts?
  1. =OR(AND(D2<>"Blocked",B2>=15,B2<=25),C2="Yes")
  2. =AND(D2<>"Blocked",OR(B2>=15,B2<=25,C2="Yes"))
  3. =AND(D2<>"Blocked",OR(AND(B2>=15,B2<=25),C2="Yes"))
  4. =AND(D2<>"Blocked",B2>=15,OR(B2<=25,C2="Yes"))
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A stock cell C2 can hold positive, zero or negative numeric quantities. The formula =IF(C2,"Available","Unavailable") labels -3 “Available.” What change expresses availability correctly, and why did -3 pass?
  1. Use C2<>0; negative numbers compare as zero.
  2. Use C2>=0; any nonzero test value is TRUE.
  3. Use C2<0; negative numbers are the positive branch.
  4. Use C2>0; any nonzero test value is TRUE.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Scores in B2 may be numbers, numeric text, the word “Away” or an empty cell. Only actual numbers may receive “Pass” or “Fail”; all other entries need “Check.” What formula enforces that distinction with a pass mark of 55?
  1. =IF(B2="","Check",IF(B2>=55,"Pass","Fail"))
  2. =IF(ISNUMBER(B2),IF(B2>=55,"Pass","Fail"),"Check")
  3. =IF(ISTEXT(B2),"Check",IF(B2>=55,"Pass","Fail"))
  4. =IFERROR(IF(B2>=55,"Pass","Fail"),"Check")
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A sheet assigns “High” at 85 or more, “Middle” at 65 to below 85 and “Low” below 65. Fractional scores are allowed. Which nested IF covers the bands without gaps?
  1. =IF(B2>=65,"Middle",IF(B2>=85,"High","Low"))
  2. =IF(B2>=85,"High",IF(B2>=65,"Middle","Low"))
  3. =IF(B2>=85,"High",IF(AND(B2>=65,B2<=84),"Middle","Low"))
  4. =IF(B2>85,"High",IF(B2>65,"Middle","Low"))
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A nested formula is =IF(B2<4,2,IF(B2<9,5,8)). What IFS formula gives the same result for valid numeric B2 values?
  1. =IFS(B2<9,5,B2<4,2,TRUE,8)
  2. =IFS(B2<4,2,B2<9,5,FALSE,8)
  3. =IFS(B2<4,2,B2<9,5,B2>9,8)
  4. =IFS(B2<4,2,B2<9,5,TRUE,8)
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A service mapping contains many code/result pairs that change every week. What arrangement makes the mapping easiest to maintain?
  1. A worksheet mapping table with a lookup.
  2. A SWITCH formula repeated in every row.
  3. A longer nested IF repeated in every row.
  4. An IFS formula with one pair per code.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

B2 contains code “R.” What does =SWITCH(B2,"P","Pending","D","Done") return?
  1. “Done”
  2. “Pending”
  3. #N/A
  4. FALSE
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

D2 is #VALUE!. E2 uses =IFERROR(D2,"Check input"), and F2 uses =ISERROR(E2). A dashboard counts TRUE values in F. Why does this row escape the dashboard, and where should the check point?
  1. ISERROR detects only #N/A; use ISNA on E2.
  2. E2 is now text; check the original D2 result.
  3. IFERROR converted the error to 0; check E2 again.
  4. Text messages count as errors; change F2 to TRUE.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A score-first nested IF skips its attendance branch when the score is too low. It is rewritten with AND inside one IF. The attendance cell now contains #N/A and the score is low. Why can the new version show an error?
  1. IF always evaluates both result branches.
  2. AND ignores the score whenever attendance fails.
  3. Nested IF converts all attendance errors to zero.
  4. AND evaluates the error-bearing attendance test.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

66 Key Terms, each with its definition

A

Absolute reference
An absolute reference fixes both column and row with dollar signs, keeping a setting cell such as $F$1 unchanged when a formula is copied.
An absolute reference lets every copied score formula read the pass mark from the same cell.
AND
The AND function returns TRUE when every supplied condition is TRUE and FALSE when at least one of the conditions is FALSE.
Use AND to require both a qualifying score and a completed form before approving a request.

B

Boundary value
A boundary value lies exactly where a rule changes outcome and helps check whether a strict or inclusive comparison has been used correctly.
Test a boundary value of 6 kg when one parcel fee applies through exactly 6 kg.
Branch
A branch is the calculation path selected by an IF test, leading to its true result or false result, which may contain another IF.
A false first comparison sends the parcel fee calculation into the next branch.

C

Comparison operator
A comparison operator compares two values for equality or order, using symbols such as =, <>, >, <, >= and <=.
The comparison operator <= includes an exact maximum mass as well as smaller masses.
Condition count
A condition count is the number of tests that return TRUE, found by adding comparisons after they are converted to 1 or 0.
Compare a condition count with >=2 when at least two of three checks must pass.

D

DATE
The DATE function constructs a date value from numeric year, month and day arguments, avoiding the ambiguity of regional date strings.
Use DATE to build June 2 explicitly as DATE(2026,6,2), regardless of display format.
De Morgan's laws
De Morgan's laws show that reversing AND gives OR of the reversed inputs, and reversing OR gives AND of the reversed inputs.
De Morgan's laws explain why “neither of two statuses” needs a not-equal comparison for each status to hold.
Default result
A default result is the outcome used when no earlier case matches, written as a final TRUE/result pair in IFS or an unpaired result in SWITCH.
A default result of “Check code” gives unmatched codes an explicit visible label.

E

Empty text
Empty text is a text value containing no characters, written as ""; it can make a formula's cell look empty while the formula remains there.
An IF false result of empty text displays nothing, but ISBLANK still finds the formula.
Error propagation
Error propagation occurs when an error in one cell passes into calculations that depend on that cell and prevents their normal results.
Error propagation can make SUM return #DIV/0! when one referenced row contains that error.
Error value
An error value is a formula result that reports a calculation problem, such as a zero divisor, unavailable value or broken reference.
A single error value can make a dependent total show an error until its cause is handled.
Evaluate Formula
Evaluate Formula is an Excel for Windows auditing tool that steps through a formula and displays intermediate values to help locate a problem.
Use Evaluate Formula to see which comparison sends a score into an unexpected IF branch.
EXACT
The EXACT function compares two text values character by character and treats uppercase and lowercase letters as different characters.
EXACT distinguishes the code “ab-7” from “AB-7” when those codes identify different items.
Exact match
An exact match is equality between an input value and a listed match value, as used by SWITCH; numeric and text types matter in Excel.
For an exact match, numeric 2 needs an unquoted numeric match value instead of text “2.”
Exclusive upper limit
An exclusive upper limit accepts values strictly below its endpoint, allowing a date window to end just before the next day begins.
Use an exclusive upper limit at July 1 to include every timestamp on June 30.
Expression
An expression is a value, reference or calculation that a formula evaluates; SWITCH compares its expression with the listed match values.
The expression WEEKDAY(B2) lets SWITCH label a date from its calculated weekday number.

F

Fallback
A fallback is a replacement result chosen for an error or unmatched case, whose type and meaning affect later calculations.
A fallback of zero counts in an average, while a fallback of empty text is ignored in a range.
FIND
The FIND function locates a character sequence with a case-sensitive comparison and returns an error when the sequence is absent.
Use FIND when uppercase and lowercase letters must remain distinct in a contains test.

H

Hard-coded value
A hard-coded value is entered directly into a formula instead of being read from a setting cell, making policy changes harder to apply consistently.
Move a hard-coded value for a discount rate into a labeled input cell when it may change.
Helper column
A helper column holds an intermediate calculation from a longer rule, making each part visible for checking, filtering and correction.
A helper column labeled “Form complete” can show why a request failed its final AND test.

I

IF
The IF function uses a logical test to choose between a true result and a false result, each of which can be text, a number or a calculation.
IF can return “Release” when a grouped test passes and “Hold” when the test fails.
IFERROR
The IFERROR function returns an error-free first argument unchanged and returns its chosen fallback when that argument produces an error.
Place the complete quotient inside IFERROR when the division is the calculation to handle.
IFNA
The IFNA function replaces only the #N/A error with a chosen fallback, leaving normal results and every other error unchanged.
IFNA can label an unlisted code while leaving a misspelled function visible as #NAME?.
IFS
The IFS function returns the result paired with the first TRUE test in an ordered list, using a final TRUE pair for a default when needed.
IFS can list descending score thresholds without placing each IF inside another IF.
Inclusive interval
An inclusive interval is a range that contains both endpoints, checked with a lower >= limit and an upper <= limit joined by AND.
An inclusive interval from 4 through 9 accepts both 4 and 9 as well as values between them.
ISBLANK
The ISBLANK function returns TRUE only for a genuinely empty cell and returns FALSE for a cell with a formula, space or other content.
ISBLANK returns FALSE for a formula cell that currently displays an empty-text result.
ISERROR
The ISERROR function returns TRUE for any formula error and FALSE for a normal value, allowing a helper check to flag failed calculations.
ISERROR must check the original result to detect an error later replaced with ordinary text.
ISNA
The ISNA function returns TRUE only for the #N/A error and FALSE for other values, including different kinds of formula errors.
Use ISNA in a helper check when unavailable values need a separate message from other errors.
ISNUMBER
The ISNUMBER function returns TRUE for a numeric value and FALSE for other value types, including numbers stored as text.
ISNUMBER flags imported text “250” for correction before a numeric threshold is applied.
ISTEXT
The ISTEXT function returns TRUE when a value is text, including text made of digits, and FALSE when the value is a real number.
ISTEXT can reveal that an imported score looks numeric but is stored as a text value.

K

Known-value mean
A known-value mean averages the numeric entries that are available, without claiming that omitted or missing values have been recovered.
Ignoring empty text in AVERAGE gives a known-value mean when a cost is still missing.

L

LET
The LET function assigns local names to values or calculations and uses them in a final calculation, allowing repeated work to be reused.
LET can name a repeated product once, then refer to that result in several tests.
Local name
A local name defined by LET identifies a value only inside that formula; it does not create a shared named setting elsewhere in the workbook.
The local name score in one LET formula cannot be used by a different formula on its own.
Logical coercion
Logical coercion converts TRUE and FALSE into numbers during arithmetic, with TRUE becoming 1 and FALSE becoming 0.
Logical coercion lets three added comparisons count how many requirements a row meets.
Logical test
A logical test is an expression that returns TRUE or FALSE, letting a formula check whether a condition holds for a value.
The logical test B2>=48 accepts 48 and higher scores while rejecting smaller numeric scores.
Logical value
A logical value is TRUE or FALSE, the two results used to express whether a condition holds and to guide a formula's decision.
A logical value of FALSE in an AND checklist prevents the combined test from passing.

M

Mapping table
A mapping table stores input values beside their corresponding results in worksheet cells, making a changing code list easier to maintain.
A mapping table is easier to edit than a long SWITCH formula when service codes change weekly.

N

Named cell
A named cell gives a worksheet reference a meaningful name, such as PassMark, so formulas can refer to its purpose instead of its address.
Define a named cell for the fixed pass mark and check that its reference is absolute.
Nested IF
A nested IF is an IF function placed inside a result argument of another IF, creating branches for more than two possible outcomes.
A nested IF can assign low, middle or high fees by following successive mass limits.
Nesting
Nesting means placing one function inside another function's arguments so its result becomes part of a larger calculation.
Nesting AND inside OR makes a paired requirement one alternative to supervisor approval.
NOT
The NOT function reverses a logical result, returning FALSE for TRUE and TRUE for FALSE, including results of combined tests.
NOT can reverse an OR test that lists two cancellation statuses, so one formula rejects both of them.
NOW
The NOW function returns the current date and time as a numeric timestamp and updates when the spreadsheet recalculates.
NOW can identify an appointment earlier this morning that a before-TODAY test would miss.

O

OR
The OR function returns TRUE when at least one supplied condition is TRUE, including when several or all of the conditions are TRUE.
Use OR when a membership or a qualifying order total is enough to earn free shipping.

P

Prefix
A prefix is a sequence of characters at the beginning of a text value, which can be checked by comparing a LEFT result with the expected text.
The prefix “INV” in “INV-502” can be checked with LEFT(B2,3)="INV".

R

Relative reference
A relative reference changes its row or column position as a formula is copied, so a reference such as B2 can follow the next record.
A relative reference to F1 becomes F2 when copied down, which is wrong for a fixed setting.

S

SEARCH
The SEARCH function finds the position of a character sequence without regard to case, returning an error when it is absent.
SEARCH can find “rush” inside “brush,” so a match does not guarantee a separate word.
Serial number
A serial number represents a date as a numeric day count in the spreadsheet's calendar system, allowing dates to be compared by size.
A later due date has a larger serial number than an earlier date in the same system.
Suffix
A suffix is a sequence of characters at the end of a text value, which can be checked by comparing a RIGHT result with the expected text.
The suffix “.pdf” can be checked with RIGHT(B2,4)=".pdf" on a filename.
SWITCH
The SWITCH function compares one expression with a list of match values and returns the first equal match's result, or an optional default.
SWITCH can translate the code “E” into “Express” without repeating the input reference.

T

Test case
A test case pairs an input with its expected result to check a branch, boundary or unusual entry before the formula is trusted.
Add a test case at the exact pass mark so an accidental strict > comparison is exposed.
Test/result pair
A test/result pair contains a condition and the value to return when that condition is selected, forming the repeated structure of IFS.
Every IFS test/result pair needs both parts; a final test without a result is incomplete.
Threshold
A threshold is a cutoff that separates outcomes, with the comparison operator deciding whether the exact cutoff belongs to a band.
A threshold of 85 with >=85 includes exactly 85 in the higher grade band.
Timestamp
A timestamp is a date and time stored together, with an integer day value and a fractional day value representing the time.
A timestamp at 17:00 is greater than the date value for midnight starting that same day.
TODAY
The TODAY function returns the current date without a time fraction and updates when the spreadsheet recalculates on a different day.
TODAY supplies a moving cutoff for an overdue invoice test that changes as days pass.
TRIM
The TRIM function removes ordinary leading and trailing spaces and reduces repeated ordinary spaces inside text to single spaces.
TRIM can remove a trailing space from an imported status before an equality comparison.
Truth table
A truth table lists every combination of logical inputs and the resulting output, so all cases of a combined rule can be checked.
A truth table for two independent conditions has four rows, including both mixed cases.

V

Version compatibility
Version compatibility means that the spreadsheet software used to open a workbook supports its functions and can calculate its formulas.
Check version compatibility before sharing LET formulas with someone using Excel 2019.

X

XOR
The XOR function returns TRUE for an odd number of TRUE inputs; with two inputs, that means exactly one must be TRUE.
With two checkboxes, XOR rejects a form where both choices have been selected.

#

#DIV/0!
The #DIV/0! error reports division by zero, including division by a cell that is truly empty and is treated as zero in the calculation.
A price-per-kilogram calculation shows #DIV/0! when its mass divisor is missing or zero.
#N/A
The #N/A error means that a value needed by a formula is unavailable, such as an unmatched code or an IFS with no TRUE test.
An unmatched SWITCH without a default produces #N/A, which IFNA can handle.
#NAME?
The #NAME? error reports an unrecognized function or name, often caused by a typing mistake or unquoted text in a formula.
A misspelling of SWITCH as SWICH can produce #NAME? before any code is matched.
#NULL!
The #NULL! error reports a requested intersection of ranges that do not intersect, often caused by an unintended space between references.
Check for a stray intersection space when a range formula unexpectedly returns #NULL!.
#NUM!
The #NUM! error reports a numeric calculation that cannot produce a valid result, such as a real square root of a negative number.
A #NUM! error should be inspected before a broad IFERROR wrapper replaces its message.
#REF!
The #REF! error reports an invalid reference, often because cells used by the formula were deleted and the reference no longer points to them.
A #REF! error needs its reference repaired; replacing the display does not restore the cells.
#VALUE!
The #VALUE! error reports that a calculation received an unsuitable value type, such as nonnumeric text used in direct arithmetic.
Multiplying the message “Missing mass” by 2 produces #VALUE! instead of a numeric result.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started