Expalin formula

sohaila

New Member
Joined
Oct 25, 2015
Messages
37
Office Version
  1. 365
Platform
  1. Windows
KINDLY EXPLAIN THIS FORMULA
THANKS


REDUCE(0,H7:H10,LAMBDA(a,b,VSTACK(TAKE(a,1),a+b)))
H FORMULA REDUCE(0,H7:H10,LAMBDA(a,b,VSTACK(TAKE(a,1),a+b)))


10
24
37
49
10
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If you use =REDUCE(0,A1:A4,LAMBDA(a,b,b)) on 1, 2, 3, 4 it returns the value last of the last row as a result, i.e. 4. The formula above does that for every row of 1, 2, 3, 4 (or 4, 3, 2, 1) and adds the result of previous calculation (a+b) to it, i.e.

1st step is 4 + initial value of a which is 0, therefore 4,
2nd step is 3 + the result of previous iteration, i.e. 4, therefore 3+4 = 7,
3rd step is 2 + 7, i.e. 9
4th step 1 + 9, i.e. 10.

The same output (although sorted in reverse order) could be achieved e.g. with =INDEX(A4,0,0)+B5 placed into B4 and copied up where B5 is 0.
 
Last edited:
Upvote 0
THANKS SOFIA FOR YOUR EXPLANATION IS IT POSSIABLE REDUCE ACT LIKE SCAN FUNCTION
 
Upvote 0
It kind of operates like it here thanks to its combination with VSTACK. If the input would be 4, 3, 2, 1, then =VSTACK(0,SCAN(0,A1:A4,LAMBDA(x,y,x+y))) would return the same output.
 
Upvote 0
I guess that if you would sort 1, 2, 3, 4 in descending order with SORT function and then use the original formula, it should return 0, 1, 3, 6, 10.
 
Upvote 0

Forum statistics

Threads
1,223,929
Messages
6,175,457
Members
452,643
Latest member
gjcase

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top