Periksa argumen opsional di LAMBDA
=ISOMITTED(argument)
| Parameter | Deskripsi |
|---|---|
argument |
The argument to test for. |
To illustrate how ISOMITTED works, imagine a simple LAMBDA formula that adds 10 any given value. With the value 100 in cell A1, this formula will retu
=LAMBDA(a,a+10)(A1) // returns 110
Next, we alter the formula to make both a and b variables:
=LAMBDA(a,b,a+b)(A1,10) // returns 110
=LAMBDA(a,b,a+b)(A1,20) // returns 120
Now let's say we want to make b optional, and we want b to default to 10 if not provided. To accomplish this, we can use ISOMITTED to check for b. We
IF(ISOMITTED(b),a+10,a+b) // test for b
Finally, we place the snippet above into the LAMBDA function as before. We also enclose b in square brackets [b] to follow the convention of optional
=LAMBDA(a,[b],IF(ISOMITTED(b),a+10,a+b))(A1) // returns 110
=LAMBDA(a,[b],IF(ISOMITTED(b),a+10,a+b))(A1,20) // returns 120
In the worksheet shown above, we are using the LAMBDA function to check password length. The LAMBDA takes two arguments, a and b. A is the password to
=LAMBDA(a,[b],IF(ISOMITTED(b),LEN(a)>=8,LEN(a)>=b))(B5)
Since b is not supplied, the passwords in column B are checked for a minimum length of 8 characters. The formula returns TRUE if a password is at leas
=LAMBDA(a,[b],IF(ISOMITTED(b),LEN(a)>=8,LEN(a)>=b))(B5,10)