ISOMITTED Function¶
The ISOMITTED function in Excel is used to check whether an argument was omitted in a LAMBDA function. It returns TRUE if the argument was not provided when the LAMBDA was called, and FALSE if a value was supplied. This function is essential for creating LAMBDA functions with optional parameters and default value handling.
Key Features of ISOMITTED:¶
- Detects whether an optional argument was omitted in a LAMBDA call.
- Returns
TRUEif the argument was omitted,FALSEif it was provided. - Works exclusively within LAMBDA functions.
- Enables creation of flexible functions with optional parameters.
- Allows implementation of default values for missing arguments.
Syntax:¶
- argument: The LAMBDA parameter you want to check for omission.
How ISOMITTED Works:¶
- When called inside a LAMBDA function,
ISOMITTEDchecks if the specified parameter was provided. - If the argument was omitted (not passed) when calling the LAMBDA, it returns
TRUE. - If any value was provided (including empty string, zero, or FALSE), it returns
FALSE. - This is typically used with
IFto provide default values for optional parameters. ISOMITTEDonly works within the context of a LAMBDA function.
Examples:¶
1. Basic LAMBDA with Optional Parameter:¶
Result:
2. Default Value for Omitted Argument:¶
Result:
(Uses default multiplier of 2 since second argument was omitted)
3. With Named LAMBDA Function:¶
Define a named function GREET with optional greeting:
Usage:
Results:
4. Multiple Optional Parameters:¶
=LAMBDA(base, rate, years,
base *
(1 + IF(ISOMITTED(rate), 0.05, rate)) ^
IF(ISOMITTED(years), 1, years)
)(1000)
Result:
(Uses default rate of 5% and 1 year)
5. Distinguish Omitted from Empty:¶
Calling with no argument returns "Omitted" Calling with "" returns "Empty string" Calling with "test" returns "test"
6. Conditional Logic Based on Omission:¶
Result:
7. Recursive LAMBDA with Optional Counter:¶
=LAMBDA(n, counter,
LET(
c, IF(ISOMITTED(counter), 0, counter),
IF(n <= 1, c + 1, SELF(n - 1, c + 1))
)
)
Result:
8. Complex Function with Multiple Defaults:¶
=LAMBDA(amount, tax_rate, discount, currency,
LET(
rate, IF(ISOMITTED(tax_rate), 0.1, tax_rate),
disc, IF(ISOMITTED(discount), 0, discount),
curr, IF(ISOMITTED(currency), "$", currency),
total, (amount * (1 + rate)) - disc,
curr & TEXT(total, "#,##0.00")
)
)(100)
Result:
(Uses default 10% tax, no discount, and $ currency)
Notes:¶
ISOMITTEDonly works inside LAMBDA functions; using it elsewhere returns an error.- An empty string
""passed as an argument is NOT considered omitted —ISOMITTEDreturnsFALSE. - Zero, FALSE, and other "falsy" values are NOT considered omitted.
ISOMITTEDis the only reliable way to detect truly omitted arguments in LAMBDA.- This function is crucial for building robust, flexible custom functions.
Applications:¶
- Default Parameters: Provide sensible defaults when users don't specify all arguments.
- Flexible Functions: Create functions that adapt behavior based on which arguments are provided.
- Backward Compatibility: Add new optional parameters to existing LAMBDA functions without breaking existing usage.
- Overloaded Behavior: Implement different logic paths depending on the number of arguments provided.
- User-Friendly Functions: Allow users to call functions with minimal required inputs.
Related Functions:¶
- LAMBDA: Creates custom, reusable functions that can have optional parameters.
- LET: Assigns names to calculation results, often used with LAMBDA for complex logic.
- IF: Used with ISOMITTED to provide conditional default values.
- IFERROR: Handles errors in function execution.
- ISBLANK: Tests whether a cell is empty (different from checking if an argument is omitted).
Tip: When designing LAMBDA functions with optional parameters, always place required parameters first and optional parameters last. Use
ISOMITTEDwithIFto provide meaningful defaults, and document your default values so users know what to expect when they omit arguments.