REDUCE

Applies a custom LAMBDA function to each element in a given array and accumulates results to a single value.

Syntaxis

=REDUCE([Initial value]; Array; Formula)

Initial value: Optional initial value of the accumulator.

Array: The array to be reduced.

Formula: a LAMBDA function that will be called on each cell of the array.

The LAMBDA function requires two variables: an accumulator (e.g., a) and the array element value (v), and must be structured as follows:

LAMBDA ( a , v , a + f ( v ) ) LAMBDA( a,v, a + f(v) )

where f(v) is a function of the individual cells of the array.

Voorbeelden

Voorbeeld

De volgende gegevens zullen als voorbeeld worden gebruikt

 

A

B

C

1

Wiskunde

Natuurkunde

Biologie

2

47

67

33

3

36

68

42

4

40

65

44

5

39

64

60

6

 

38

43

7

47

84

62

8

29

80

51

9

27

49

40

10

57

49

12

11

56

33

60

12

57

 

 

13

26

 

 


The formula =REDUCE(100000;A2:A13;LAMBDA(a;v; a + v*v)) returns 120715, which is 100000 added to the sum of the squares of the Math column.

Technische informatie

Tippictogram

This function is available since LibreOfficeDev 27.2.


Deze functie maakt GEEN deel uit van de standaard Open Document Format for Office Applications (OpenDocument) Versie 1.3. Deel 4: Herberekende formule (OpenFormula)-indeling. De naamruimte is

COM.MICROSOFT.REDUCE

Help ons, alstublieft!

Help ons, alstublieft!