Logical Functions: AND, OR, NOT, IFS, SWITCH and IFERROR
IntermediateLesson 1 of 7 in Spreadsheet Formulas and Functions Course
What you will learn
- 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 ORUse 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 XORTurn 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 IFPlace AND, OR and NOT inside IF to return a label, a number or a calculation, and count how many conditions a row meets.
- Require all or any conditions with AND and OR
- 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 cellsCompare 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 timesCompare dates as the numbers spreadsheets store them as, build fixed and moving date limits with DATE and TODAY, and handle times correctly.
- Test text values and empty cells
- 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 formulasPlace 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 IFSWrite 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 SWITCHTranslate codes and fixed values into results with SWITCH, add a default, and know when IFS or a lookup table is the better choice.
- Build nested IF formulas
- 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 IFERRORKnow what the common error values mean and use IFERROR to return a chosen result in place of any error.
- Catch missing values with IFNAUse IFNA to handle the "not found" case alone, so that every other error still shows.
- Prevent and expose errors instead of hiding themTest for the expected problem before it causes an error, keep unexpected errors visible, and see how a careless replacement value changes totals and averages.
- Catch errors with IFERROR
- 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 readUse 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 branchPut 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.
- Lay out long formulas so they can be read
Logical Functions study guide
1Combine 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 condition | Second condition | AND | OR |
|---|---|---|---|
| TRUE | TRUE | TRUE | TRUE |
| TRUE | FALSE | FALSE | TRUE |
| FALSE | TRUE | FALSE | TRUE |
| FALSE | FALSE | FALSE | FALSE |
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))equalsOR(NOT(x),NOT(y)): at least one condition fails.NOT(OR(x,y))equalsAND(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.
2Write 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 contains | B2="" | ISBLANK(B2) |
|---|---|---|
| Nothing at all | TRUE | TRUE |
A formula returning "" | TRUE | FALSE |
| One space | FALSE | FALSE |
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.
ISBLANKrejects 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.
3Choose 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.
| Decision | Clear function choice |
|---|---|
| One expression matches fixed codes | SWITCH |
| Scores or weights fall into bands | IFS or nested IF |
| Different cells supply different tests | IFS or nested IF |
| A long or frequently edited mapping | A 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.
4Handle 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
| Error | Common meaning |
|---|---|
#DIV/0! | Division by zero or an empty divisor |
#N/A | A 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
| Replacement | Effect |
|---|---|
"No weight" | Explains the expected problem in the displayed result |
"" | Returns text that looks empty |
0 | Supplies 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
| Formula | When 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
| Situation | Suitable approach |
|---|---|
| A known cause such as a zero divisor | Test the cause with IF |
| An expected unavailable value | Use IFNA |
| Every error needs the same display treatment | Use 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.
5Keep 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
1Build a decision from several conditions
12 steps
- 1IntroductionTurn 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.
- 2ExplanationWrite both requirements
The normal route has two complete comparisons:
B2>=70andC2="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. - 3ExampleRequire 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. - 4ChallengeCheck 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. - 5ExampleAdd 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. - 6Key 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.” - 7ExplanationExclude 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.” - 8ChallengeChoose 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. - 9ExampleReturn 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. - 10ExplanationCount 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>=2for an “at least two” rule. - 11ChallengeKeep 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.
- 12RecapRead 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.
2Check entries before deciding
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionA display is not the stored value
- 2ExampleChoose the text comparison
- 3ExplanationFind a sequence or an ending
- 4ExampleTell two blank displays apart
- 5ChallengeReject a text score
- 6ExplanationMake the limit a date value
- 7ExampleStart the month at midnight
- 8ExampleEnd before the next month
- 9ChallengeBuild a moving window
- 10ChallengeHandle a missing due date
- 11RecapChoose the test that fits the value
3Choose an outcome and a clear formula
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionBands and codes need different decisions
- 2ExplanationWrite the bands with clear endpoints
- 3ExampleFollow a parcel into the second IF
- 4ChallengeTest both boundaries
- 5ExampleFlatten the same rule
- 6Key InsightA fallback does not fix ordering
- 7ChallengeFill the final pair
- 8ExplanationTranslate a fixed code
- 9ExampleMatch the value type
- 10ChallengeKeep thresholds as tests
- 11ConnectionChoose a form others can maintain
- 12RecapTrace the value to its outcome
4Handle a missing result without hiding a broken formula
10 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionDecide what an error means
- 2ExampleRead the failed calculation
- 3ExampleWrap all of the quotient
- 4ChallengeFollow a message into arithmetic
- 5ExplanationCatch only an unavailable value
- 6ChallengeKeep a typo visible
- 7ExamplePrevent the known cause
- 8ExampleSee how a zero changes an average
- 9ChallengeChoose the narrow treatment
- 10RecapMatch the handler to the failure
5Make a formula easy to update and test
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionMake the rule visible
- 2ExampleShow intermediate checks
- 3ExplanationName values inside the formula
- 4ChallengeChoose where a name belongs
- 5ExampleCheck the copied reference
- 6ExplanationChoose tests before trusting labels
- 7TipInspect the intermediate value
- 8ChallengeFind the missing case
- 9ConnectionCheck the receiving app
- 10ChallengeRepair the rule and verify it
- 11RecapLeave a formula others can check
Logical Functions practice questions
Set 1: Read tests and follow decisions10 Practice Questions
Question 1 of 10
Show answerHide answer
>=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
Show answerHide answer
Question 3 of 10
=IF(A2="","",A2) and currently displays nothing. What does =ISBLANK(B2) return?Show answerHide answer
B2="" on this empty-text result.Question 4 of 10
=AND(B2>=DATE(2026,5,1),B2<DATE(2026,6,1)) return?Show answerHide answer
<=DATE(2026,5,31) would reject 16:00, but that is not the upper limit in this formula.Question 5 of 10
=IF(B2>=50,"Basic",IF(B2>=80,"High","Low")) return?Show answerHide answer
Question 6 of 10
=IFS(B2>=30,"Large",B2>=20,"Medium") return?Show answerHide answer
#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
=IFERROR(B2/C2,"Check mass") return?Show answerHide answer
#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
=IFNA(B2/C2,"Missing") return?Show answerHide answer
#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
=AND(E2:G2) return in Excel?Show answerHide answer
#VALUE! applies when the range has no usable logical or numeric values at all.Question 10 of 10
=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?Show answerHide answer
$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
=IF((B2>=75)+(C2>=70)+(D2="Yes")>=2,"Review now","Wait") return?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
=ISNUMBER(SEARCH("rush",B2)) return?Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
B2*C2 several times inside one formula. What feature can name and reuse that calculated value locally?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
=IF(B2<=3,2,IF(B2<=8,5,9)) give for 8 kg?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
=SWITCH(B2,"1","First","2","Second","Other") return?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
=IFERROR(B2,0)/C2 return?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
net_cost, B4, AB12 or c?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
=IF(B2>=$H$1,"Accept","Review"). What formula appears when it is copied one row down?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
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
=IFS(TRUE,"Standard",B2>=40,"Priority"). What result appears, and what ordering change is needed if scores of at least 40 should be “Priority”?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
#N/A. What does =IFNA(B2,"Not listed") return?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
=IFERROR(D2,0) and =IFERROR(D2,"") when those results enter an AVERAGE range?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
#REF!. What do =ISNA(D2) and =ISERROR(D2) return, in that order?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
>= comparisons. Which group best tests both boundaries?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
#N/A. What does =AND(E2,F2) return?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
=IF(C2,"Available","Unavailable") labels -3 “Available.” What change expresses availability correctly, and why did -3 pass?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
=IF(B2<4,2,IF(B2<9,5,8)). What IFS formula gives the same result for valid numeric B2 values?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
=SWITCH(B2,"P","Pending","D","Done") return?Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
#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?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
#N/A and the score is low. Why can the new version show an error?Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Absolute reference
$F$1 unchanged when a formula is copied.AND
B
Boundary value
Branch
C
Comparison operator
=, <>, >, <, >= and <=.<= includes an exact maximum mass as well as smaller masses.Condition count
>=2 when at least two of three checks must pass.D
DATE
DATE(2026,6,2), regardless of display format.De Morgan's laws
Default result
E
Empty text
""; it can make a formula's cell look empty while the formula remains there.Error propagation
Error value
Evaluate Formula
EXACT
Exact match
Exclusive upper limit
Expression
WEEKDAY(B2) lets SWITCH label a date from its calculated weekday number.F
Fallback
FIND
H
Hard-coded value
Helper column
I
IF
IFERROR
IFNA
IFS
Inclusive interval
>= limit and an upper <= limit joined by AND.ISBLANK
ISERROR
ISNA
ISNUMBER
ISTEXT
K
Known-value mean
L
LET
Local name
score in one LET formula cannot be used by a different formula on its own.Logical coercion
Logical test
B2>=48 accepts 48 and higher scores while rejecting smaller numeric scores.Logical value
M
Mapping table
N
Named cell
Nested IF
Nesting
NOT
NOW
O
OR
P
Prefix
LEFT(B2,3)="INV".R
Relative reference
S
SEARCH
Serial number
Suffix
RIGHT(B2,4)=".pdf" on a filename.SWITCH
T
Test case
Test/result pair
Threshold
>=85 includes exactly 85 in the higher grade band.Timestamp
TODAY
TRIM
Truth table
V
Version compatibility
X
XOR
#
#DIV/0!
#N/A
#NAME?
#NULL!
#NUM!
#REF!
#VALUE!
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.