3.13 IF, Nested IF and IFS
Turn a condition into a clear decision
A shop reviews a set of online orders before sending the daily handover. A small basket should be tagged differently from a large one. Another member of the team wants to know whether each order qualifies for an invented free-delivery offer. Those are two separate decisions made from the same amount. Excel can apply either rule to every row if you state the values, comparisons and outcomes precisely.
We will use synthetic quick-commerce amounts inspired by familiar apps like Blinkit and Amazon Now. A short mock training score example introduces the first IF formula. We will then test amounts at the exact order-band and fee boundaries. The score cutoffs, order bands and offers are workbook examples. You can verify all results from the inputs printed on the page.
- Translate a rule. Turn “at least 40” into a comparison, then provide the result for each outcome.
- Check the boundary. Test below, at and above the exact value where the outcome should change.
- Put overlapping tests in order. Make sure a higher band receives a chance to match before a lower band catches the same amount.
- Separate data quality from business logic. Keep missing or invalid input visible before assigning a normal category.
Read the three jobs inside IF
A useful form of IF has a logical test, an outcome when it is true, and an outcome when it is false. A logical test is a question that evaluates to TRUE or FALSE. In =IF(B2>=40,"Pass","Retry"), the question is whether the value measured in B2 is at least 40. When the test is true the expression returns the text Pass. Otherwise it returns the text Retry. Write both outcomes explicitly in learning exercises so the formula explains your intent.
Trace each part in plain language
- First argument.
B2>=40compares a value in B2 with the passing mark. Run it independently as=B2>=40in a scratch cell to observe the Boolean result. - True outcome.
"Pass"is literal text. Double quotes tell Excel to return those characters. - False outcome.
"Retry"gives the meaning of a false test in this example. A real workflow might need different text such as Needs training, or a separate numeric calculation.
Keep the commas in the examples as argument separators if your Excel uses commas. Your Excel installation may use a different list separator. In that case keep the same order of arguments and use the separator expected by your configuration. The order of arguments matters even when the visible spacing or separator varies.
Choose return values based on their next use
IF can return a label, a number, a cell's value or a calculation. A delivery fee of 30 used in an invoice total should be numeric, so write 30 without quotes in that expression. An explanation such as “Delivery fee applies” is text. If you use the text "30" in a fee formula, it may look identical in the grid while having a different data type that affects later aggregation or export.
Which part of IF decides whether 40 qualifies as a pass?
The test B2>=40. It includes equal to 40 as well as greater scores. The text outputs describe the result; they do not set the boundary.
Choose the exact comparison for the rule
Comparisons must use the right field and unit. If a policy says up to 12 minutes is on time, compare a numeric duration measured in minutes with 12. If your duration is a day fraction, convert it first. If someone asks whether an order is in the Delivered status, compare the status field with the text label "Delivered". Pick the operator based on the rule's wording, then verify the equality case.
| Comparison | Meaning | Result for 40 |
|---|---|---|
B2>40 | Strictly greater than | FALSE |
B2>=40 | At least 40 | TRUE |
B2=40 | Exactly 40 | TRUE |
B2<40 | Below 40 | FALSE |
B2<=40 | At most 40 | TRUE |
B2<>40 | Different from 40 | FALSE |
Test before, at and after the threshold
Write 39, 40 and 41 on three rows. An at-least-40 rule produces Retry, Pass and Pass. A greater-than-40 rule produces Retry, Retry and Pass. The same majority of cases can succeed under both patterns while the exact threshold fails. In money examples include amounts such as 199.99, 200 and 200.01 if the source permits cents or paise. Nearby records expose an unintended inequality faster than a large hand-picked set of clearly low and high values.
Sometimes a source's displayed rounding hides the relevant difference. A result shown as ₹200 may be 199.995 underneath if the calculation uses more precision. Decide whether membership in a band uses raw amounts, rounded amounts from a defined calculation or already-rounded input. Check the value and the comparison rather than relying on a formatted display. The examples below use explicit ordinary amounts and include 199.99 as a test.
Check text inputs against the documented labels
For a status check such as =IF(I2="Delivered","Include","Review status"), verify the actual stored label. An extra space imported at the end can affect equality. If your process has a defined vocabulary, clean or map the labels deliberately before classifying them. Where the business requires case-sensitive identifiers, use a suitable case-sensitive test such as EXACT rather than depending on normal text comparison. Keep the original if the data-cleaning decision needs review.
Handle blanks and incorrectly typed values first
A missing score has a different meaning from zero. Zero can be a valid measured score and normally gives Retry under our cutoff. A blank score means the class has no value available. Send it to a Missing category. Similarly a text input that looks like 40 may have been imported as characters. Check it before comparing it with a numeric rule.
Add a quality gate before a numeric rule
For a beginner exercise, B2="" can route an empty input or a formula-produced empty string to Missing. If you need to distinguish a cell with no contents from a formula that displays an empty string, use a separate check appropriate for your data. Next use ISNUMBER(B2) to check the type. It returns TRUE for a number and FALSE for numeric-looking text. It checks type only. A number such as −3 still needs a validity check if scores must be zero through 100.
- Missing. Route blanks through a visible condition before using the value in business logic.
- Wrong type. Route a word or text number to review until you confirm how to convert it.
- Outside range. Flag a numeric score below zero or above 100. The type is valid and the value breaks the exercise's rule.
- Valid measured result. Compare the value with the cutoff and return the category that the policy describes.
This separation also helps a count or dashboard. A Retry count tells you how many valid scores missed the training threshold. A Missing count tells you how many still need a score. If you combine those cases under the same label, a manager cannot tell whether training was ineffective or the file was incomplete. Labels form part of the evidence when a report is shared.
The cell displays 40, but ISNUMBER returns FALSE. What should the workbook do?
Flag the record for type review. Inspect the source and convert it only when the expected meaning is confirmed. After conversion, verify that the real numeric value 40 qualifies as Pass.
Use nested IF for several outcomes
A nested IF is an IF expression used as one outcome of another IF. Suppose a shop assigns Premium to an amount of at least ₹1,000, Regular to at least ₹200 and less than ₹1,000, and Small to the remaining nonnegative amounts. After validating the input, put the highest threshold first. Then put a second IF in the false path of the first. The final false path supplies the Small outcome.
=IF(B2>=1000,"Premium",IF(B2>=200,"Regular","Small")) reads in this order. If B2 is ₹1,299, the first condition is true and the result is Premium. If B2 is ₹270, the first condition is false and the second is true, so the result is Regular. If B2 is ₹64, both tests fail and the result is Small.
Test a record that satisfies more than one raw comparison
A ₹1,299 amount also exceeds ₹200. If you start with the broad ₹200 test, you can wrongly return Regular before the Premium case is considered. This is why the order of tests depends on how they overlap. When using lower-bound tests for a rising band, check the highest cutoff first. Other policies may use upper bounds or separate non-overlapping conditions. Draw the ranges or write a decision table before deciding which test comes first.
Read the final outcome as an intentional rule, too. In the amount example Small applies to validated nonnegative amounts below 200. If you use this formula before checking the input, the final fallback can produce a label that appears valid even when there is an unresolved problem in the source. Run the validation conditions separately or before the band decision.
Why is ₹1,000 the most important Premium boundary test?
It qualifies for the top band exactly at its threshold and also satisfies the broader ₹200 condition. A correct formula returns Premium. A formula that puts the broader test first or uses greater-than rather than at-least can misclassify it.
Use IFS as a list of ordered test and result pairs
IFS lets you put successive tests and their outcomes in one expression. It returns the result associated with the first true condition. For the same validated order amount, =IFS(B2>=1000,"Premium",B2>=200,"Regular",TRUE,"Small") produces the same three bands. The raw amount tests still overlap. IFS makes the pairs easier to scan, while the priority remains your responsibility.
Read the final TRUE pair as a documented fallback
The last logical test TRUE always succeeds if Excel reaches that decision. It provides a default result when earlier tests fail. Without the final pair, a valid ₹64 record would match no amount condition and IFS would return #N/A. With the fallback it becomes Small. Keep the fallback at the end. Put it earlier and it can make the following bands unreachable for the records that get that far.
A fallback is a decision about what to do with remaining inputs. If a code must belong to one of four supported values, a fallback could be Review code. If approved bands cover only numeric amounts after validation, Small is meaningful in the remaining range. Choose a distinctive fallback label for unexpected states so you can count and investigate them later.
Make changing rules easy to check
Nested IF and IFS both work for a short reviewed set of thresholds. Keep a separate decision table when the rules change often. Give each threshold a label and an owner, and check that their sequence still makes sense after an edit. For a longer rate schedule, an approximate lookup against a clear threshold table can be easier to maintain. You will see that technique in the lookup chapter. When IFS is unavailable in your Excel edition, use the equivalent nested IF for these exercises.
What does IFS return when none of its conditions is true?
With no default pair it returns an unavailable-result error, #N/A. The last pair TRUE,"Small" makes the intended remaining result explicit for this validated exercise.
Trace the order amount at a boundary
Inspect the input
The order amount is a real numeric ₹1,000. It is nonnegative and the row has a value. Send the valid amount through the band rules.
Test Premium first
Is ₹1,000 at least ₹1,000? Yes. The comparison includes equality, so the Premium result is selected.
Understand the overlap
₹1,000 is also at least ₹200. A lower band cannot take this record if its test comes after Premium. A lower-band-first formula would give the wrong category.
Check the neighbouring amount
For ₹999.99 the Premium check is false. The Regular check succeeds. These two nearby values confirm both the comparison symbol and the decision order.
Lab 1 · Build a score label and catch the exceptional inputs
Goal. Turn a practice passing threshold into a formula, test the equality boundary, and add an explicit result for values that need review. Start in a blank editable scratch workbook. Add a worksheet called Score Check. Put Record, Score, Basic Result and Reviewed Result in A1:D1.
- Build the boundary cases. Put T-01, T-02 and T-03 in A2:A4 and enter 39, 40 and 41 in B2:B4. In C2 enter
=IF(B2>=40,"Pass","Retry")and fill down through C4. The results are Retry, Pass and Pass. Read the first and last formulas to verify the row reference adjusted. - Change one comparison. In C3 temporarily use
=IF(B3>40,"Pass","Retry"). Expect Retry. Restore the original comparison after observing the change. Explain why a formula working on 39 and 41 can still fail the business instruction at 40. - Enter five distinct controls. Use T-04 through T-08. Leave B5 blank. Enter text
40by typing a leading apostrophe in B6. In B7 and B8 enter 103 and −3 using the standard minus sign for the negative input. In B9 enter the numeric zero. These rows test failures of completeness, type and allowed range. - Build the reviewed result. In D2 use the expression below. It checks for an empty input, then asks whether the nonempty value is numeric. In the numeric path it tests both invalid ranges before comparing the valid score with 40. Fill D2 down through D9.
- Validate both outcomes and reasons. Match the outputs with the table. Convert the text 40 in B6 to the real numeric value 40 in this scratch copy, then confirm that its reviewed result changes from Review to Pass. If a missing input becomes a valid Retry, inspect which condition receives it.
=IF(B2="","Missing",IF(ISNUMBER(B2),IF(B2<0,"Review",IF(B2>100,"Review",IF(B2>=40,"Pass","Retry"))),"Review"))
| Record | Input | Reviewed result | Reason |
|---|---|---|---|
| T-01 | 39 | Retry | Valid score below 40 |
| T-02 | 40 | Pass | Valid at the cutoff |
| T-03 | 41 | Pass | Valid above the cutoff |
| T-04 | Blank | Missing | No measured score |
| T-05 | Text 40 | Review | Wrong input type |
| T-06 | 103 | Review | Outside allowed range |
| T-07 | −3 | Review | Outside allowed range |
| T-08 | 0 | Retry | Valid measured zero |
Expected evidence. Two Pass, two Retry, one Missing and three Review rows precede the B6 correction. Confirm that the formula gives a different result for B5 and B9. A blank measurement and a valid score of zero need different actions. Save a scratch copy with both formulas if you want to inspect it later.
Lab 2 · Classify order bands and calculate a separate numeric fee
Goal. Compare nested IF and IFS on the same data and verify that a fee rule can use a different threshold. Create another worksheet called Order Rules. Put Case, Amount, Nested Band, IFS Band and Fee in A1:E1. Use the test amounts in the table. Some come from the larger practice Orders dataset, and the exact cutoff cases are deliberately added.
- Choose the assumptions. For a valid nonnegative value, amounts of ₹1,000 and higher are Premium. Remaining amounts of ₹200 and higher are Regular. Remaining valid amounts are Small. Our invented delivery programme charges 30 at amounts under ₹500, and zero from ₹500 up. A label and a fee answer different questions.
- Enter the nested expression. In C2 write the first formula below and fill down. It handles empty input and type before the band checks. Numeric amounts below zero are assigned Review before the normal thresholds.
- Compare the IFS version. In D2 write the second formula and fill down in an Excel edition that supports IFS. For missing IFS support, use the C column formula and manually verify the first true pair from the list. For supported installations, add
=C2=D2beside each row in an empty column and confirm TRUE everywhere. - Calculate the amount separately. In E2 use the fee formula below. If C2 reports Missing or Review, return an empty display in the Fee column and let the band field carry that data-quality explanation. For valid rows, return the numeric 0 or 30. Never describe an empty fee for an invalid row as a confirmed zero fee.
- Break the priority in a spare copy. Test a wrong formula that checks ₹200 before ₹1,000 on the 1,299 row. Confirm the result Regular is wrong. Remove the temporary formula after observing it. Leave approved decisions on the worksheet with their original priority.
C2 =IF(B2="","Missing",IF(ISNUMBER(B2),IF(B2<0,"Review",IF(B2>=1000,"Premium",IF(B2>=200,"Regular","Small"))),"Review"))
D2 =IF(B2="","Missing",IF(ISNUMBER(B2),IFS(B2<0,"Review",B2>=1000,"Premium",B2>=200,"Regular",TRUE,"Small"),"Review"))
E2 =IF(C2="Missing","",IF(C2="Review","",IF(B2>=500,0,30)))
| Case | Amount (₹) | Expected band | Expected fee (₹) |
|---|---|---|---|
| Sample small | 64 | Small | 30 |
| Just below regular | 199.99 | Small | 30 |
| First regular | 200 | Regular | 30 |
| First fee-free | 500 | Regular | 0 |
| Just below premium | 999.99 | Regular | 0 |
| First premium | 1000 | Premium | 0 |
| Sample premium | 1299 | Premium | 0 |
| No amount | Leave blank | Missing | Leave blank |
| Negative amount | −20 | Review | Leave blank |
| Text amount | Text 500 | Review | Leave blank |
Expected evidence. Seven fees are numeric and three are withheld for quality checks. Summing the numeric fees gives ₹90. A fee of zero is a valid calculated fee for a qualifying order. If you use COUNT to audit numeric fee cells, it counts the measured zeroes. If your code mislabels 1,000 or 200, check the first applicable condition. Use your own scratch file and restore the valid formulas after tests.
Review decision outputs before using them elsewhere
Inspect one condition at a time
When an expression becomes difficult to read, write the comparisons in temporary columns. Put =B2>=1000 in one column and =B2>=200 in another for validated amounts. Each returns TRUE or FALSE. Check the rows just below or at their thresholds. Then inspect which true result comes first in the decision formula. This makes the problem smaller than rewriting a long sequence of parentheses.
When Excel rejects the formula before calculating, check quotation marks, the argument separator and parentheses. Literal labels need text quotes. A nested IF occupies one value argument of the outer function. Identify which outcome should contain the new condition and make the entire nested expression that outcome. In IFS check that every condition has its corresponding result.
Use stable labels and measurable outputs
If another worksheet counts Premium orders, it should be able to find the exact Premium label. Inconsistent spelling or extra whitespace can cause an understated count. Keep a small decision table in the file so a reviewer can compare the intended labels with the actual output. Use numeric results for totals, and use a separate explanatory field for missing or rejected data.
Consider a workbook that sends different actions after classifying an order. A Premium label can mean a high amount. A fee-free value can mean a lower fee threshold. Neither directly gives a shipping priority unless the operations policy says it does. When you reuse an output, read what it measures and confirm that the downstream action uses the same business definition.
Test revisions against known controls
Suppose the regular band moves from ₹200 to ₹250. Check that 199.99 stays Small, 200 changes to Small, 250 becomes Regular, and 1,299 stays Premium. The last control is useful because it should be unaffected. A fee-free cutoff at ₹500 can stay the same. Record the date and reason for a policy change when a workbook serves as a recurring reporting tool.
The fee column has a mix of numeric zero and empty-looking results. How do you audit it?
Count numeric fee values and review the separate band/status field for the cases with no fee. A numeric zero indicates a real computed result in the example. A formula returning empty text should not be counted as a measured numeric fee.
Return a calculation when the condition qualifies
A spreadsheet decision can produce an amount instead of a label. Imagine a small Amazon Now-inspired practice report where a shop estimates a campaign credit. For validated nonnegative basket amounts of at least ₹500, the credit is 10% of that basket. Otherwise it is zero. This is an invented campaign rule. The order band field still uses its separate ₹200 and ₹1,000 thresholds.
Choose the right value for each route
In a test column use =IF(B2>=500,B2*10%,0) on validated order rows. If B2 is 499.99, it is slightly below the threshold and the credit is 0. At 500 the credit is 50. At 600 it is 60. Returning the word Eligible would answer a useful yes-or-no question, but it would leave no numeric credit to sum. Keep a separate status when someone needs both a searchable label and a unit amount.
Compare the 500 case with the fee example. The same basket is Regular, has zero delivery fee, and would get a 50 credit under this second hypothetical rule. All three outputs are consistent because they represent different decisions. Keep each calculation in a separate column and confirm which columns should flow into the final balance.
Include a value only when a known status qualifies
The ordering worksheet also has a Status column. A report might ask for the sum of recorded amounts for delivered rows. When the statuses have been checked, use =IF(C2="Delivered",B2,0) in a scratch example where C2 holds the status and B2 holds its numeric amount. A row with Delivered and 64 contributes 64. A row with Cancelled and 240 contributes zero under this specific report rule. Another row with Returned and 195 also contributes zero.
Those zeroes explain eligibility for the measure. The original order amounts remain in the input column. The total of the three recorded amounts is 499, and the sum of contributions under the delivered rule is 64. If a later report wants net revenue, confirm the accounting and return definitions first. Summing all recorded values, summing delivered values and measuring net revenue can answer different business questions.
Check an unexpected status in a separate quality step. A misspelled Delivered can quietly fall through to zero even though the transaction should qualify. Compare the recognised statuses with the source, retain unknown rows for review, and test one known Delivered result and one confirmed Cancelled result when the calculation is revised. This makes the chosen condition visible before the team relies on the total.
Choose a result type that supports the next step
- Number. Return numeric zero if the rule truly calculated an amount of zero. It should appear as one measured case when you count numerical rows.
- Label. Return short consistent text for a status field. Use a stable label that another report can filter or count.
- Missing calculation. Put a visible status in a separate field and leave the amount empty-looking if policy says the amount cannot be calculated. A formula returning empty text can still be counted by COUNTA. Use a numerical count when auditing measure availability.
For a multi-row report, select one example with a credit and one without, then verify the total on paper. If all credit results are unexpectedly zero, inspect the actual threshold condition and check the input value's unit. If a formula merely says “eligible” without a quantity, change only the amount output or create a separate measure column.
Move thresholds into cells when a rule will be revised
On a workbook used every week, people may need to change a band without rewriting formulas in every row. Put the current approved limits in a small named area with labels. For a scratch worksheet write Premium minimum in G2 and 1000 in H2, then Regular minimum in G3 and 200 in H3. Keep the condition order stable. The shared cells hold values the formula can reference.
Keep the threshold references fixed while copying
For a validated numeric amount in B2 use =IF(B2>=$H$2,"Premium",IF(B2>=$H$3,"Regular","Small")). The B2 address is relative so that each order uses its own amount. The two absolute references keep the chosen thresholds in place across the report. Select the final copied row and check that its monetary input points to that row even as H2 and H3 stay fixed.
Set the Premium minimum to 1,200 in the practice file. A previous Premium amount of 1,000 now becomes Regular, 1,199.99 becomes Regular and 1,200 is Premium. The sample 1,299 remains Premium. These checks demonstrate that the workbook picked up the new rule and retained the intended equality. Restore 1,000 after the exercise unless you are saving a separately labelled scenario.
Validate a configuration before applying it
The stated policy needs the regular threshold to be below the premium threshold. If somebody sets H3 to 1,300 and H2 to 1,000, the regular test can never receive an amount large enough to pass. The first test already caught every amount of 1,300 or more. Place a simple check beside the inputs, such as =IF(H3<H2,"OK","Review thresholds"), once both cells have been validated as numeric. Include the actual dates and owners of changed assumptions in ongoing reports.
Your threshold changes from 1,000 to 1,200. Which boundary verifies that equality is still included?
Test 1,199.99 and 1,200. The first is below the minimum and the second qualifies. A test of 1,299 confirms one previously Premium amount remains unchanged.
Reconcile decision outputs to the source records
A review sheet is useful only if its labels describe every input you expected. The ten synthetic Order Rules rows should produce two Small, three Regular, two Premium, one Missing and two Review results. A report of seven valid rows accounts for the first three groups and leaves three rows that need work. Check the category counts before sharing a fee total.
Review recognised and exceptional cases together
In a blank cell use =COUNTIF(C2:C11,"Regular") to check the Regular count. Repeat for the other known labels in a scratch summary. The totals should add to the ten input records. If your category total is lower, inspect the uncounted values and the report range. A typo, an extra blank result or a formula left unfilled can produce a hole in the report even while the fee total looks reasonable.
Use =COUNT(E2:E11) separately to count numeric fee outcomes. It gives 7 in the lab. Compare it with the valid band count rather than using a nonempty cell count for fee completeness. Four valid fee results of zero do not add to the money total, but they still contribute to this control count.
Keep mismatches as evidence to investigate
If the source itself contains an Excel error, a direct comparison may also result in an error. Do not erase that evidence merely to give the row a normal category. Find the missing input, invalid reference or other upstream cause. Use a separate review status for a situation you understand and want to handle. The next lessons distinguish ordinary rule decisions from handling a specific calculation error.
Use the same controls when another worksheet reads the categories. Reconcile records included in that report, check the policy version, and inspect one valid boundary and one missing case by hand. A count tied to a clearly identified source range lets a teammate check what changed when new records arrive. Add one row to the scratch table and check that every classification formula and summary range includes it. If the raw record count rises but the category totals stay unchanged, inspect both ranges before investigating the decision logic.
Try three new decisions and explain the results
- Check the exact service deadline. Return Late for a valid numeric duration greater than 12 minutes. Test 11, 12 and 13. Check. Expect On time, On time and Late. The phrase “up to 12” includes the boundary.
- Test the small-band fallback. Remove the final TRUE pair from the IFS example in a spare cell and test 64. Check. No explicit threshold is true, so IFS returns
#N/A. Restore the fallback after explaining why this value should be Small. - Change the order of two cases. Place the ₹200 condition first and test ₹1,299. Check. The result is Regular even though the original policy calls it Premium. Put the highest threshold first and verify the corrected result.
Check your understanding
1. Which comparison includes an exact score of 40 in Pass?
- A. B2>40
- B. B2>=40
- C. B2<40
Answer B. It means greater than or equal to 40. The strictly greater operator excludes a score equal to 40, so would incorrectly send that score to Retry.
2. What happens if you test at least ₹200 before testing at least ₹1,000?
- A. A ₹1,299 order is mapped to Regular
- B. The amounts are compared in descending order automatically
- C. Excel returns both labels
Answer A. The broad Regular test is true for ₹1,299, so it can take the row before the intended Premium condition. Check the more selective lower-bound threshold first.
3. What does the last pair TRUE, “Small” do in IFS?
- A. It converts text numbers
- B. It always overrides every earlier match
- C. It supplies Small if the earlier tests do not match
Answer C. The first true test supplies the output. The final TRUE is reached when the preceding tests are false for the decision. Keep it last and send invalid inputs through a quality check first.
4. Which fee value works as a numeric input to a later total?
- A. The string "30"
- B. The number 30
- C. The label "Charge 30"
Answer B. Return a number for a measurable amount. Text is useful for explanatory labels, but a number-like string does not provide the same numeric type to every later calculation.
5. A score cell contains the measured number zero. Which lab result should it produce?
- A. Missing
- B. Pass
- C. Retry
Answer C. Zero is a valid numeric score in the training rule and is below 40. Blanks are taken by a different branch so an absence of evidence is not treated as a measured zero.
6. A ₹500 order is Regular and fee-free under the sample policy. Is that consistent?
- A. Yes, the two outcomes use separate thresholds
- B. No, all Regular orders have to pay
- C. No, fee-free is a synonym for Premium
Answer A. The band rule places 500 between 200 and 1,000. The fee rule returns zero starting at 500. Separate columns let you verify both without confusing one rule for the other.
Interview questions with worked answers
- How do you translate a condition from a stakeholder into IF?
I confirm the field and unit, identify whether the cutoff is inclusive, and choose a clear result for each outcome. For “passes with at least 40” I use
=IF(B2>=40,"Pass","Retry")after checking the input is a valid score. I test 39, 40 and 41 before applying it to every row.- When should you check higher thresholds first?
When each category uses a minimum threshold and the categories overlap, I put the most selective higher threshold first. An order for 1,299 meets both sample conditions. The policy says Premium, so the Premium check must be evaluated ahead of Regular. I write the ranges first to see the overlap clearly.
- How do you decide between nested IF and IFS?
I choose a readable structure supported by the team's Excel edition. For three short bands, nested IF is straightforward. IFS presents clear ordered pairs and needs an explicit last fallback where one is intended. For frequently changed thresholds I would consider a maintained lookup table.
- Why add a validation branch before calculating a fee?
A blank, text amount or out-of-policy value can reach a normal branch if I compare it directly with a threshold. I first validate the input and label exceptions. I return numeric 0 or 30 only when the amount is valid. This keeps fee totals and exception counts interpretable.
- How would you review a report where counts suddenly changed after a formula update?
I compare expected results for boundary controls before and after the change. I look at each condition's Boolean result and the first matching case. I also check label spelling and data type. I reconcile the sum of normal and exception categories to the known number of records to see whether anything was lost.
Quick recall cards
- IF
Write a logical test and specify what the formula returns for true and false outcomes.
- Equality matters
At least 40 includes 40. Test below, at and above important thresholds.
- Nested IF
Put a complete IF expression in one branch when another decision is needed.
- IFS
Returns the first matching result. Put an intentional default pair last when appropriate.
- Type check
A text number, a missing input and a numeric zero can look similar. Test the actual data and preserve their meaning.
- Measure and label
Return numeric values for totals and stable text for classifications. Audit each outcome against its own rule.
In the next lesson you will combine multiple tests and map exact category values. Keep individual Boolean questions small enough to verify. A larger decision becomes easier to maintain when you can explain each part and show a case where it matters.
Official Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.