Help ons, alstublieft!

LAMBDA

De LAMBDA-functie maakt het mogelijk om aangepaste functies te creëren, waardoor u herbruikbare formules met verschillende invoerwaarden kunt schrijven. Het ondersteunt ook geavanceerde functies zoals recursie en hogere-orde functies.

=LAMBDA(Parameter 1 [; Parameter 2 [; ... [; Parameter n]...]]; Formule)

Parameter 1: (verplicht) De naam van de eerste parameter van de functie. De naam moet voldoen aan de benamingsregels voor bereiken en mag niet de uitvoer zijn van een referentie of tekstformule. Het bereik van de parameternaam is beperkt tot de LAMBDA-functie.

Parameter 2; ...; n: (optioneel). Aanvullende parameters voor de functie. Dezelfde naamgevingsregels als voorParameter 1 zijn van toepassing.

Formule: een formule-expressie. Deze moet het laatste argument van de functie zijn.

Gebruik

Notitiepictogram

For interoperability with other office suites, the LAMBDA function must be entered as a named formula.


  1. Open menu Sheets - Named Range and Expressions - Define.

  2. Assign a name to the expression.

  3. Write the LAMBDA function expression in the Range or formula expression box.

  4. Use the named expression, passing the parameters for the LAMBDA function.

Voorbeeld van een eenvoudig meetkundig gemiddelde

  1. Assign name MY_MEAN as a named expression.

  2. Enter =LAMBDA(Number1;Number2;SQRT(Number1*Number2)) in the Range or formula expression box.

  3. Voer, in cel B1, =MY_MEAN(2;3) in.

  4. Cel B1 toont het getal 2,44948974278318, de vierkantswortel van 2 maal 3.

Notitiepictogram

If you don’t assign a name to LAMBDA expression, you can still use it by entering the formula in cell A1 and enter =A1(2;3) in B1. The LAMBDA function displays the Greek character lambda (λ) in cell A1. However, this makes the formula less readable and will cause interoperability issues with other office suites.


Voorbeeld van een recursieve aanroep van een LAMBDA-functie.

  1. Assign name MY_FACTORIAL to a named expression

  2. Enter =LAMBDA(n;IF(n>1;n*MY_FACTORIAL(n-1);1)) in the Range or formula expression box.

  3. Voer, in cel B1, =MY_FACTORIAL(5) in.

  4. Cel B1 zal 120 weergeven.

ISOMITTED gebruiken in functie LAMBDA.

The ISOMITTED function allows you to handle missing parameters in a LAMBDA function. For example, the LAMBDA function named MY_FUNCT:

=LAMBDA(_n1; _n2; IF(ISOMITTED(_n2); "Missing second parameter"; _n1/_n2))

returns "Missing second parameter" if the LAMBDA function is called as =MY_FUNCT(3;). Note: The trailing argument separator (;) must be included in the function call.

Tippictogram

Deze functie is beschikbaar sinds LibreOfficeDev 27.2.


Deze functie maakt GEEN deel uit van de standaard Open Document Format voor kantoortoepasingen (OpenDocument) versie 1.4. Deel 4: Recalculated Formula (OpenFormula) indeling. De naamruimte is

COM.MICROSOFT.LAMBDA