Ravindra BagaleCourses & study guides मराठी Track your progress

9. Dynamic Arrays

Excel

9.18 Named LAMBDA Functions in Name Manager, with Optional Arguments (ISOMITTED)

Write one workbook function with a default that callers can override

Isha is preparing a fictional Swiggy and Blinkit-inspired training workbook. Most practice deliveries use a 15-minute threshold. One analysis uses 12 minutes. If she copies two versions of the formula everywhere, a later change can leave some worksheets using the wrong rule. She wants one named function that applies the usual threshold when no override is supplied.

A parameter is the name of an input inside a LAMBDA definition. An argument is a value the person supplies for that input when calling it. A default is the rule's chosen value when an argument is specifically omitted. ISOMITTED lets the calculation recognize that omission and choose the default. Giving the function a workbook-wide name makes it easier to call using the same rule from different tabs.

Test the calculation and optional input in a cell first

For this specific workshop, “Late” means minutes strictly greater than the chosen threshold. An order exactly at the threshold is On time. All figures are fictional and no timing policy is being described for either real service. Start with a small test, then model the default before registering the workbook name.

=LAMBDA(minutes,limit,IF(minutes>limit,"Late","On time"))(16,15)
=LAMBDA(minutes,limit,IF(minutes>IF(ISOMITTED(limit),15,limit),"Late","On time"))(16,)

Both calls return Late, for different reasons. The first uses the explicitly supplied limit of 15. The second gets 15 from the inner IF because the second slot is empty. The comparison uses that resolved value. Try a different input, such as 14, with each form. You can compare the final label while seeing where the numerical value came from.

  • Plain parameter name. Enter limit as part of the definition with no square brackets. Microsoft's current ISOMITTED documentation shows ordinary parameter names and an empty slot in the call.
  • Specify which slot is missing. For a two-parameter rule, (16,) supplies the first value and intentionally omits the second. It keeps the number of positions visible to the workbook reader.
  • Do not treat a supplied value as omitted. Numeric 0 is a real argument, and a literal "" is explicitly supplied text. An empty worksheet cell passed as a reference is also a separate case to design and test, rather than the same call syntax as an omitted slot.
  • Use the calculation as the final part. Inside the definition the expression that returns Late or On time is last. The test invocation comes after the definition. Save only the definition when you create the workbook name.

Use a descriptive name for every parameter. Microsoft documents a LAMBDA limit of 253 parameters and says periods should not be used in parameter names. Avoid names that resemble references. This workbook uses two short parameters and readable named functions so another learner can review them. Microsoft lists both LAMBDA and ISOMITTED for Microsoft 365, Excel 2024 and Excel for the web. Verify function support and the Name controls in the receiving app.

Use the same ten order records in each comparison

Enter this fixture in A1:I11 on Orders. Minutes are numeric in H2:H11. The practice platform names and timestamps are invented. Do not reuse the example as an actual service policy.

Orders A1:I11. Column C is City, G is Amount, and I is Status.
Order IDDateCityPlatformCategoryQtyAmountMinutesStatus
BLK-10012 Nov 2026PuneFreshGoDairy2649Delivered
BLK-10022 Nov 2026NashikFreshGoFruits327012Delivered
AMN-10033 Nov 2026PuneMarketRushSnacks111014Delivered
BLK-10043 Nov 2026NagpurFreshGoFruits224011Cancelled
AMN-10054 Nov 2026KolhapurMarketRushDairy423216Delivered
BLK-10064 Nov 2026PuneFreshGoBakery51508Delivered
BLK-10075 Nov 2026SolapurFreshGoHome1129918Delivered
AMN-10086 Nov 2026Sambhaji NagarMarketRushStaples319510Returned
BLK-10097 Nov 2026PuneFreshGoSnacks222013Cancelled
BLK-10108 Nov 2026NashikFreshGoFruits19017Delivered

Lab 1. Name the tested LATEFLAG and compare two thresholds

Use a new practice workbook or a disposable copy. Review any existing defined names before adding LATEFLAG. Microsoft documents Formulas → Name Manager on Windows and Formulas → Define Name on Mac for defining this rule. The goal is one workbook-scoped name, so both Orders and a separate Tests tab can call it.

Name settings for the practice workbook.
FieldWhat to enter
NameLATEFLAG
ScopeWorkbook, so both practice sheets can call it
CommentMinutes, then optional limit. Omit limit for 15. Equality is On time.
Refers toThe LAMBDA definition below, beginning with an equal sign and with no test call appended
=LAMBDA(minutes,limit,IF(minutes>IF(ISOMITTED(limit),15,limit),"Late","On time"))
  1. Create the workbook name with that definition. The comment documents how the missing slot works. Save the name before trying the calls.
  2. On Tests, verify =LATEFLAG(16,) returns Late and =LATEFLAG(15,) returns On time. Their only difference is the amount of time. These inputs check the strict comparison at the fallback limit.
  3. On Orders put Default 15 in J1 and Override 12 in K1. In J2 and K2 enter the following two calls separately. Leave J2:K11 open because each returns ten labels.
  4. Count Late in each spill using =COUNTIF(J2#,"Late") and =COUNTIF(K2#,"Late") outside the output area. Expect three and five.
  5. Check the changed IDs, AMN-1003 with 14 and BLK-1009 with 13. Under 15 both are On time. Under 12 both become Late. BLK-1002 at 12 remains On time under either threshold.
=LATEFLAG(H2:H11,)
=LATEFLAG(H2:H11,12)

Under the default rule the late IDs are AMN-1005, BLK-1007 and BLK-1010, with minutes 16, 18 and 17. The override includes those same three plus the two between 12 and 15. The example runs the comparison for every order's recorded duration, regardless of its Status. The time threshold and the status condition are separate business decisions.

With 14 minutes, an omitted limit uses 15 and gives On time. A supplied limit of 12 gives Late and a supplied zero also gives Late.
Distinguish the empty argument slot from an actual supplied number.

Run one input through the default and override

  1. Supply the measured time

    The 14-minute record is AMN-1003 in the practice source.

  2. Leave the second slot empty

    ISOMITTED sees the missing argument, so use 15. The result is On time.

  3. Provide a 12-minute threshold

    ISOMITTED is false. The rule compares 14 to 12 and returns Late.

  4. Test the boundary too

    A duration of exactly 12 is On time under a 12-minute limit.

Filter the report's population deliberately

If the manager asks for lateness among Delivered records, include that condition in the later count rather than assuming LATEFLAG understands Status. In the 12-minute spill, BLK-1009 is Late but Cancelled. =COUNTIFS(I2:I11,"Delivered",K2#,"Late") gives four for the original source. Count the other result the same way and get three. State whether the totals describe all measured durations or only delivered orders.

Lab 2. Distinguish an omitted discount from an explicit zero

Make a new Discounts tab. The retail exercise uses a made-up 10% practice discount when none is supplied. Passing a discount of zero means no discount. This task teaches a common bug: checking whether a supplied value equals zero to infer whether it was omitted. The two cases make different business decisions.

Test the following inline formula first. Give it 50 as the original amount and leave the discount argument slot empty. The inner IF uses 10% only for a missing argument. The result is 45. Now pass numeric zero in the second position. That should return 50. Pass 20% and it returns 40.

=LAMBDA(amount,discount,amount*(1-IF(ISOMITTED(discount),10%,discount)))(50,)

When the three tests pass, define NETSALES with workbook scope. In Refers to save only the following expression. In the comment say that caller supplies numeric amount, then optional decimal rate. Omission uses 10%, and zero keeps the full amount.

=LAMBDA(amount,discount,amount*(1-IF(ISOMITTED(discount),10%,discount)))
Put the product and amount in A1:B4. Use the last three fields as expected checks.
ItemAmountDefault 10%Override 20%Explicit 0%
Pen pack50454050
Notebook set200180160200
Bag400360320400
Total650585520650
  1. Use =NETSALES(B2:B4,) to create a three-row default result. Compare with 45, 180 and 360.
  2. Use =NETSALES(B2:B4,20%) in a separate column. Verify 40, 160 and 320.
  3. Use =NETSALES(B2:B4,0) in another free column. These outputs should equal the three original amounts. The lower total for the default version follows intentional policy, not a workbook error.
  4. Sum the three outputs separately. The original total is 650, default is 585, override is 520 and zero-rate total stays 650. Verify one row by hand, then reconcile the groups.
For an amount of 50, omission uses a 10 percent discount and gives 45. A 20 percent override gives 40. An explicit zero discount gives 50.
Use a control where the default and a valid zero produce clearly different results.

Set the accepted type and range when other people can call the function

The first NETSALES formula assumes usable numeric data. Under a simple training policy allow a rate from zero through one, meaning 0% through 100%, and a nonnegative numeric amount. In a separate practice name, such as NETSALES_CHECKED, use the following scalar definition. Type checks come before comparisons. A supplied text value should give a readable message rather than slipping into arithmetic.

=LAMBDA(amount,discount,
   LET(rateUsed,IF(ISOMITTED(discount),10%,discount),
       IF(NOT(ISNUMBER(amount)),"Check amount",
          IF(amount<0,"Check amount",
             IF(NOT(ISNUMBER(rateUsed)),"Check discount",
                IF(OR(rateUsed<0,rateUsed>1),"Check discount",amount*(1-rateUsed)))))))

Use single values with this checked version. The OR is a combined scalar test for the accepted limits. Check =NETSALES_CHECKED(50,) for 45 and =NETSALES_CHECKED(50,0) for 50. An explicit empty text argument or a value of two should give Check discount. A negative or text amount should give Check amount. Not all valid business policies reject negative amounts or set that rate interval. The lesson's goal is to make the version you choose behave consistently.

If you accept a discount entered in a worksheet cell, test the cases where it is a real number, truly blank, or a formula yielding empty text. A cell reference is an argument even if the cell looks empty. If the interface needs an “auto” setting for that case, translate it into an explicit omitted-slot call or document the supplied value behavior. Keep it separate from the choice of a numeric zero.

Give the default and supplied values distinct tests

Create a compact test table that anyone can rerun before editing a shared workbook definition. Put Call, Expected and Actual in a blank Tests area. For each case record the formula or a short label, type the expected text or numeric result as a separate value, and put the caller's formula in the Actual column. Use an adjacent check formula such as =IF(B2=C2,"Pass","Review"). Reference the correct expected and actual cells on your sheet.

  • Ordinary default case. =LATEFLAG(14,) should be On time under the fallback of 15.
  • Exact default boundary. =LATEFLAG(15,) should be On time because the comparison is strictly greater.
  • Default boundary exceeded. =LATEFLAG(16,) should be Late.
  • Lower supplied threshold. =LATEFLAG(14,12) should be Late, though the same duration with an omitted limit is On time.
  • Lower threshold equality. =LATEFLAG(12,12) should be On time.
  • Known explicit zero. =LATEFLAG(14,0) should be Late for this worksheet's rule. Check that a later edit does not treat it as the default of 15.

Confirm the numeric tests in the second lab as well. An exact percentage multiplication can sometimes display a rounded amount. For verification compare an amount rounded to the same agreed precision or an expected small tolerance, rather than confusing number display with storage. In these examples the default and overridden totals give an independent hand calculation. Keep the single row tests because a total can hide a problem that changed two rows in opposite directions.

Use a worksheet setting without confusing a cleared cell and an omitted slot

On Tests put a heading Override or leave empty in M1. The team wants a truly unused M2 to mean “use default.” For this exercise choose an explicit interface: when the cell is genuinely blank, call the function with the empty argument position. When the input cell supplies a number, pass it through. If the cell contains another kind of content, give a status.

=IF(ISBLANK(M2),LATEFLAG(14,),IF(ISNUMBER(M2),LATEFLAG(14,M2),"Check limit input"))

Try an unused M2 for On time, then enter 12 for Late. Enter 0 separately and expect Late. A formula that returns empty text belongs to the third path in this interface and shows Check limit input. A user could intentionally choose a different presentation rule. The worksheet check here establishes the meaning of the interface independently of any automatic conversion Excel applies to a value inside a LAMBDA.

Keep workbook names, expectations and changes discoverable

A named function starts as a worksheet formula, but it is reused through the workbook's defined names. Anyone reviewing the file should be able to find the name definition. Microsoft documents name scope and comment controls. A workbook-scoped name can be recognized from its worksheets. A sheet-scoped name has a narrower context and the web app has limits on creating sheet-scoped names. Use workbook scope for the exercises so the result doesn't change when someone calls it from a different tab.

Review a proposed change with a separate test copy

Suppose the training team changes the ordinary default from 15 minutes to 13. Keep a saved practice copy of the working definition with all six tests. On another copy edit the named rule's fallback to 13. Replace the expected results of the default calls according to the new rule rather than changing all expected columns to whatever the actual formulas return. For the original ten durations, there are now four Late IDs. The new record in that group is AMN-1003 at 14. BLK-1009 is at the rule's exact new boundary of 13 and remains On time.

The explicit 12-minute override still gives five Late labels. The explicit zero test still returns Late and is not an example of this new default. That is how you detect if a change accidentally affected overrides. A workbook-level definition can affect every caller when it recalculates. Record the previous rule, updated rule and rows you deliberately verified. Use a fresh backup or the old definition if the results fail the new agreed test cases.

Explain the parameter contract in the workbook

  • Give the name a clear description, such as LATEFLAG for a status label rather than a count.
  • Document argument order. For LATEFLAG it is measured duration first and optional threshold second. Both use minutes as the unit.
  • Record the fallback and what happens at equality. “Use 15 if omitted. Late means strictly greater than the limit” is precise.
  • State whether the formula accepts one amount or a whole range. A formula inside a helper may reduce an array to one value. A per-value comparison can return separate labels for a range.
  • List input compatibility and references. A function with no external Table references can be easier to move. A name containing a fixed source-sheet reference needs that source to exist in the receiving file.

Microsoft documents an optional comment for defined names, including its use in function assistance in supported Excel. Keep a visible Tests sheet too. A name's comment can fit the basic contract, whereas examples and error states are easier to review in cells. If the workbook goes to another person, make sure they can find both the function definition and its exact tests.

For reuse across files, start from a trusted saved practice template or define the workbook name intentionally in a new file. Check the receiving workbook has that exact name scope and any source fields it depends on. Copying a grid by itself should not be treated as an installation of a custom function. Referenced names or data can conflict or create links that the new file does not intend. Open the new copy independently and try known calls before sharing it.

Practice and answer key with the original dataset

Restore the ten Orders records and their original amounts. Make the named definitions in a separate practice copy or give them fresh names that do not collide with existing definitions. The percentage rates below are arithmetic examples only.

Calculate an 18% practice surcharge on the largest order

Define PRACTICESURCHARGE as =LAMBDA(orderAmount,orderAmount*18%). On the unchanged Orders sheet the largest order is BLK-1007, with G8 equal to 1299. =PRACTICESURCHARGE(G8) gives the surcharge alone, ₹233.82.

Write a reusable Delivered amount query for Pune

Define DELIVEREDTOTAL as =LAMBDA(cityName,SUMIFS(Orders!$G$2:$G$11,Orders!$C$2:$C$11,cityName,Orders!$I$2:$I$11,"Delivered")). =DELIVEREDTOTAL("Pune") returns 324. The two criteria combine city and status. The absolute ranges deliberately cover this fixed practice fixture.

Reuse the same named query for Nashik

=DELIVEREDTOTAL("Nashik") returns ₹360. Two rows match, with amounts 270 and 90. Check the matching IDs BLK-1002 and BLK-1010. Passing another city does not require editing the definition.

Allow an optional amount multiplier for the practice surcharge

Define PRACTICEFEE as =LAMBDA(orderAmount,rate,orderAmount*IF(ISOMITTED(rate),18%,rate)). On Orders use =PRACTICEFEE(G3,) for 48.60. With 5% explicitly supplied it gives 13.50. An explicit zero rate gives zero.

Document the definition with a short comment

In the name settings, describe PRACTICESURCHARGE as “Numeric amount in rupees. Returns the surcharge amount at the fictional 18% practice rate.” The wording identifies both the calculation and the expected unit, so people don't assume it returns the combined amount.

Apply the same per-order surcharge to the whole Amount field

Use =SUM(PRACTICESURCHARGE(G2:G11)) on the original source. It gives ₹516.60. With no per-row rounding and the same rate everywhere, that agrees with 18% of the ₹2,870 source sum. Changing the calculation to a different rate per record would change the meaning of that shortcut.

Return an alternate status label for a fictional service target

Define DELIVERYSLA as =LAMBDA(minutes,promise,IF(minutes<=IF(ISOMITTED(promise),15,promise),"Within SLA","Missed")). SLA is a service-level agreement or service target. =DELIVERYSLA(H2:H11,) gives three missed records. Passing a limit of 10 gives seven misses. Use =SUM(--(DELIVERYSLA(H2:H11,10)="Missed")) to verify that count over all recorded durations.

Return a percentage change with an explicit zero-baseline message

Define PCTCHANGE as =LAMBDA(oldAmount,newAmount,IF(oldAmount=0,"No baseline",(newAmount-oldAmount)/oldAmount)). =PCTCHANGE(520,610) gives about 17.31% after a percentage format. =PCTCHANGE(0,610) gives No baseline because the percentage relative to zero is undefined. This required baseline parameter has no default and should be passed deliberately.

Choose where the function receives its data

Compare two kinds of named function from the exercise. NETSALES accepts an amount and a discount. It can work on numeric values entered in any sheet in its workbook. DELIVEREDTOTAL accepts a city and reads a fixed Orders range inside its definition. That is convenient for this workbook, but moving its name somewhere else would still require the intended Orders data to exist.

For a portable learning exercise, make another named function that accepts the actual source arrays as inputs. The caller can then see exactly which record population the question is using. The definition below expects one city, a column of city values, the aligned amounts, and the matching status values. Use the supplied numeric fixture. Give it a different name, QUERYDELIVERED, so you can compare its contract with the fixed worksheet version.

=LAMBDA(cityName,cityValues,amountValues,statusValues,
   SUM(IF((cityValues=cityName)*(statusValues="Delivered"),amountValues,0)))

On the original Orders sheet, call =QUERYDELIVERED("Pune",C2:C11,G2:G11,I2:I11). Expect ₹324. Call it for Nashik for ₹360. The three arrays provide ten values each, in the same source order. The mask represents one needed city and one needed status. The SUM combines the original amounts from that population.

Try choosing a city such as Delhi which has no records. The sum is zero in this specific definition. That answer is a sum of qualifying order amounts and is not evidence a known order had amount zero. A report may want a separately stated count or a name with a deliberate no-match message. Also note that this definition trusts the types in its input. It does not align independently sorted arrays or validate imported text amounts. Verify those before relying on this example outside the practice fixture.

Keep one concrete test when the input size changes

Append a fictional Delivered Pune row with a known amount 125 to a copy. When calling QUERYDELIVERED, extend all three supplied ranges to row 12. Its Pune result should become ₹449. The original fixed-reference DELIVEREDTOTAL still reads the ten known rows and remains ₹324 under that definition. This comparison is useful when reviewing a disagreement after appending. It tells you which rule read a different source instead of implying that the same named calculation somehow has two outcomes.

Use structured Table fields for the parameters if you need a growing source. The name can accept those field arrays as caller inputs. The new Table record still needs to be within its defined boundary. A name's reuse does not make an arbitrary address automatically include new rows. Run your append test in both caller sheets and keep the workbook's source contract visible.

Name the calculation according to the amount it returns

In the practice exercises, a surcharge is only the extra amount. A total including a surcharge includes the base plus the extra. These formulas can use the same percentage and still return different numbers. If a name simply says Rate or Fee, someone might add the base amount to a result that already includes it. Write the output's meaning in the name and comment.

In a separate Tests area, define TOTALWITHPRACTICEFEE with this optional-rate example. All percentages are fictional. It accepts the base amount as the required value and chooses 18% only when the rate position is omitted.

=LAMBDA(orderAmount,rate,
   LET(rateUsed,IF(ISOMITTED(rate),18%,rate),orderAmount*(1+rateUsed)))
  1. Test the omitted slot at 1000 using =TOTALWITHPRACTICEFEE(1000,). The result is 1180, a total including an extra 180.
  2. Use =TOTALWITHPRACTICEFEE(1000,5%). Expect 1050. The 50 is the extra, while the output includes the original 1000.
  3. Pass zero as the rate. The result is still the base 1000. Compare that with PRACTICEFEE at an explicit zero rate, which gives an extra amount of zero.
  4. Check by subtracting the original amount from the total. Across the three test inputs the differences are 180, 50 and zero. Compare those with the same rates passed to the extra-only calculation.

When you review a spreadsheet, ask what each result should measure before checking whether the arithmetic looks right. For the same 1000 and default percentage, one formula is supposed to give 180 and another 1180. If someone changes the assumed rate for both, repeat both tests at the same approved input. A shared base rate cell could keep formulas consistent, but its scope and maintenance then belong in the workbook's instructions.

Keep a percentage or missing result usable by another formula

The PCTCHANGE exercise returns numeric percentages where a baseline exists and a text message where it is zero. This works for a human-facing label. If a later chart should compare percent changes, use separate numeric results and status fields or select only valid observations. Treat No baseline as a different business situation from an observed change of 0%. Confirm 520 to 520 gives zero. For 0 to 520 the percentage cannot be defined using the usual baseline division.

A workbook can publish its own reference sheet listing functions, input order, units and output type. For example, LATEFLAG returns text for each measured duration, NETSALES returns amounts, and PCTCHANGE returns a ratio or a status. A receiver should know whether a text value in the result is a planned status or indicates an input fault. Add one known return-type check alongside each numeric example. The more widely a workbook function is reused, the more important that brief contract becomes.

Decide where a range call should spill

The Orders example returns one label for each of ten durations. Place its range call in a free area outside an Excel Table. If each record needs a label within its own Table row, use a current-row reference instead. On a Table with a numeric Minutes field, =LATEFLAG([@Minutes],) asks for the default and returns one label. Compare the results with the external array when both read the same ten records. They should each account for three Late and seven On time results.

Reserve the space needed by the entire result before testing a range. An empty-looking formula next to the anchor can still mark a cell already in use. A scalar success only shows a single value worked. A separate range test proves the calculated shape and helps find a blocked cell. Verify the record count and two known threshold boundary results in each layout before using it as the basis for another report.

Before handing off the exercise, compare the selected workbook edition and the source prerequisites for all named rules it uses. Excel may display a saved number while a different tool cannot recalculate it. Verify by changing a passed amount in the compatible practice copy and checking the expected new output. Then restore the original test inputs.

Troubleshoot the definition, the invocation and its arguments

  • Excel shows #CALC! for a formula with only the definition. In a worksheet cell add a call such as (16,) after the LAMBDA. A bare definition is useful in a named function's Refers to field. The worksheet test needs an invocation that returns a result.
  • A name fails on one worksheet. Check whether you created a workbook-scoped or sheet-scoped definition. Check spelling and which workbook contains it. During testing, use a unique name to avoid accidental overlap with an existing one.
  • You get #VALUE! for an unexpected argument count. Compare the call with the parameter list. Use the explicit omitted slot for the optional argument in the current documented pattern. Provide the required minutes or amount. Remember that the final expression in the definition is not another parameter.
  • The output has the wrong number of cells. Compare one supplied value with a range call. An element-wise comparison can return many labels. A function that uses SUM can collapse an input to one number. Leave the spill space required by the intended call.
  • The default seems to apply after entering zero. Inspect whether the old formula checked equality to zero instead of using ISOMITTED. Verify 14 minutes with omitted, 12 and 0 separately. For the discount rule, 50 with an explicit 0 must stay 50.

Keep the minimal inline check as a first test. If the app cannot recognize ISOMITTED even in that test, use a compatible version or make the threshold an explicit input to a standard worksheet formula in the shared workbook. An older workbook can still document a default in a Settings cell. The teaching task here is to make the rule executable and inspect its version support, without hiding an unknown-function error as a supposed result.

Quiz with explained answers

Which call requests the default threshold for 14 minutes?

Use =LATEFLAG(14,). The second slot is intentionally empty, so the default 15 is chosen. The result is On time. Providing a second numeric argument changes the threshold instead of using the fallback.

Why does a duration of 15 give On time under the default?

The comparison is strictly greater than 15. Equality does not satisfy it. The first moment classified Late depends on the time resolution of your inputs. The fixture uses whole minutes, so the adjacent test 16 returns Late.

What is the difference between NETSALES with an omitted rate and an explicit zero?

For amount 50 the omitted slot uses 10%, so it gives 45. An explicit zero means no discount, so it gives 50. Both are valid and produce different answers. Checking whether a number is zero would incorrectly treat the explicit value as missing.

How many late labels are there across the original ten rows at 12 minutes?

Five. The durations 14, 16, 18, 13 and 17 exceed 12. One of those is from a Cancelled record. If the report says Delivered only, applying that separate status condition leaves four late records at this threshold.

What goes into Refers to for a named LAMBDA?

Enter the definition beginning with the equal sign. Leave off the test invocation. The invocation was useful for proving the rule in one cell. The defined name needs to keep the function callable with other values.

What happens to the explicit 12-minute calls when the default changes to 13?

They still use 12 and still produce five late labels on the original source. The fallback controls only omitted arguments. Counts under the new default change to four. The contrast is a regression check for a maintenance edit.

Interview questions you can answer from practice

How would you document an optional argument for people sharing an Excel workbook?

I would put its expected type and unit, the default, the omitted-slot syntax, and the boundary rule in the workbook. For LATEFLAG that is duration in minutes, limit in minutes, use 15 when omitted, and Late only above the limit. Then I would provide a visible test for a default and an override.

How do you stop a blank-looking input from masking a real override?

Decide what each interface state means. An explicitly omitted slot and numeric 0 are different. A truly blank control cell may be translated to the default call if the workbook specifies that. Text or a formula returning empty text can be handled separately. Test the four states rather than assuming their display settles the meaning.

What would you verify when moving a named formula into another workbook?

Check its name, scope, required functions and referenced source data. A calculation like a percentage discount may only need passed values. A city total rule can depend on an Orders sheet with specific fields. In the new workbook call one known case and confirm no unplanned links or name conflicts were introduced.

How would you safely change the default of a live workbook rule?

Keep the original definition and known tests. In a practice copy, update only the fallback. Verify the new default results and the boundary cases with supplied values. The explicit calls should behave the same. Tell readers which version they have and retest after sharing.

What evidence proves a LAMBDA works for a column of values?

Check that the result has one position per intended input and compare a few rows to independent scalar calls. For LATEFLAG the status spill has ten rows and the expected counts. A rule named for a per-record result should not unexpectedly aggregate the entire source, and its consumers should know the shape.

Revision cards

  • Parameter and argument. The definition names its inputs. The caller supplies values to those positions.
  • Documented omission. Use a plain parameter name and intentionally leave its argument position empty.
  • Zero is supplied. A defined zero-rate override must not become the default rate.
  • Save only the rule. Use workbook scope for a function multiple sheets should call.
  • Test the boundary. Equality and one value above the limit should make the rule obvious.
  • Audit changes. Compare default and override results before and after updating a shared name.

Microsoft references