Can anybody explain this fomrula
REDUCE(0,H7:H10,LAMBDA(a,b,VSTACK(TAKE(a,1),a+b)))
h7 1
h8 2
h9 3
h10 4
result
0
4
7
9
10
thanks
Can anybody explain this fomrula
REDUCE(0,H7:H10,LAMBDA(a,b,VSTACK(TAKE(a,1),a+b)))
h7 1
h8 2
h9 3
h10 4
result
0
4
7
9
10
thanks
maybe it will help:
The expression you provided is a formula in Excel or Google Sheets that uses the `REDUCE` function along with `LAMBDA`, `VSTACK`, and `TAKE`. Let's break it down:
1. **REDUCE**: This function takes an initial value (in this case, `0`) and a range of values (from `H7:H10`). It applies a function to combine them iteratively.
2. **Initial Value (0)**: The calculation starts with `0`.
3. **Range (H7:H10)**: This is the range of cells that will be processed.
4. **LAMBDA(a, b, ...)**: This defines an anonymous function that takes two parameters:
- `a`: The accumulated value from the previous iteration.
- `b`: The current value from the range being processed.
5. **VSTACK(TAKE(a, 1), a + b)**: This part combines the results:
- `TAKE(a, 1)`: This takes the first item from the accumulated value `a`.
- `a + b`: This adds the current value `b` to the accumulated total `a`.
- `VSTACK(...)`: This stacks the first item of `a` and the sum `a + b` vertically.
### What It Does
Essentially, this formula iterates through the values in the range `H7:H10`, maintaining a running total while also storing the first accumulated value. The result is a vertical array where the first entry is the initial value (from `a`), and the subsequent entries are the cumulative sums of the values in `H7:H10`.
### Example
If `H7:H10` contains values like `1`, `2`, `3`, and `4`, the output would be a vertical array:
- The first value would be `0`.
- The second would be `1` (0 + 1).
- The third would be `3` (1 + 2).
- The fourth would be `6` (3 + 3).
- The fifth would be `10` (6 + 4).
In summary, this formula creates a cumulative sum from the specified range, while also capturing the initial state.
that's all what I can do 4 u
sandy
I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt
Thanks for your explanation but final result is
0
4
7
9
10
i can't understand
Bookmarks