Hi there,
I would like to build a calculation in Power Apps to duplicate the feature of SUMPRODUCT function in Excel:
A11 is an input of a fixed rate, A14-A20 are tiers inputs, B14-B20 are +/- rates inputs. C14-C20 are based on the Fixed Rate +/- the rate from column B, e.g.: B14 = 1%, so C14 = fixed rate 5% + B14 = 6%.
And we will have another input B23 which is an amount, I d like to apply sumproduct function, here is how to calculate:
(sumup in Column E)
(if b23 > A14, (b23-a14)* C14 )+ (if b23>A15, (b23 -A15)*C15) ... until (if b23>A20, (b23-A20) *C20)
Now i build the matrix A14:C20 into a gallery, i could referral the numbers by using:
Lookup(gallery, TierID = varRowIndex, Tiers) to get the tiers or the same format to get the rates.
All other cells in input boxes or labels, also easy to referral. And i am looking for a better way than:
If( lbl_Amount > Lookup(gallery, TierID = 1, Tiers),
(lbl_Amount - Lookup(gallery, TierID = 1, Tiers)) * Lookup(gallery, TierID = 1, Rates),
0) +
If( lbl_Amount > Lookup(gallery, TierID = 2, Tiers),
(lbl_Amount - Lookup(gallery, TierID = 2, Tiers)) * Lookup(gallery, TierID = 2, Rates),
0) +
...
If( lbl_Amount > Lookup(gallery, TierID = 7, Tiers),
(lbl_Amount - Lookup(gallery, TierID = 7, Tiers)) * Lookup(gallery, TierID = 7, Rates),
0)
I could get the result correctly and am expecting a way with better efficiency and reusable.
Thank you!


Report
All responses (
Answers (