Forum Discussion
PeterBartholomew1
Feb 20, 2022Silver Contributor
SUM not working with result from Lambda helper fn.
I picked up a banded commission problem from another forum and tried to apply routines I had written for FIFO allocation. It may have been a sledgehammer to crack an awkwardly shaped nut, but the La...
- Feb 20, 2022
This one works
= LET( commission, Allocateλ(+salesAmount,Bands, Rate), SUM(commission))The difference is in +salesAmount . Auto-lifting not always works.
SergeiBaklan
Feb 20, 2022Diamond Contributor
This one works
= LET(
commission, Allocateλ(+salesAmount,Bands, Rate),
SUM(commission))
The difference is in +salesAmount . Auto-lifting not always works.
PeterBartholomew1
Feb 20, 2022Silver Contributor
Thank you for that suggestion. The use of REDUCE did appear as overkill and was difficult to justify. The '+' is far neater and it appears to work used preceding any of the 3 parameters or even outside the Allocateλ function.
= SUM(+Allocateλ(salesAmount,Bands,Rate))Now I just have to hope that someone contributes a more standard approach on the Chandoo forum, otherwise I may feel obliged to actually assist!