Forum Discussion
Sum of incentive amount based on the cell values
- Jan 07, 2023
We may do step by step
In first step we return the matrix where each column corresponds to each model in Table1. Row indicates if such model is in related row of Table2 in Models. We use double dash "--" to convert TRUE and FALSE to 1 and 0 accordingly.
On second step we MMULT above matrix with incentives column of Table1. MMULT multiplies values in each row of matrix on related incentives value and return the sum for the row (first column matrix value * first row incentives value + second column matrix value * second row incentives value).
On third step we generate current name filter on Names in Table2.
Finally multiply one on another and sum resulting vector to have total sum for the current name.
- ishaqibJan 07, 2023Copper ContributorThank you for your response sir, For now, i got my answer but didn't understand how this formula work
- SergeiBaklanJan 07, 2023MVP
We may do step by step
In first step we return the matrix where each column corresponds to each model in Table1. Row indicates if such model is in related row of Table2 in Models. We use double dash "--" to convert TRUE and FALSE to 1 and 0 accordingly.
On second step we MMULT above matrix with incentives column of Table1. MMULT multiplies values in each row of matrix on related incentives value and return the sum for the row (first column matrix value * first row incentives value + second column matrix value * second row incentives value).
On third step we generate current name filter on Names in Table2.
Finally multiply one on another and sum resulting vector to have total sum for the current name.
- ishaqibMar 21, 2023Copper Contributor
HeySergeiBaklan I need your little help, It was running good but there should be a condition that if a salesperson sell a model with lower of its price then no incentive will be given, we have to ignore that sales. How can we do that? I tried to use sumif and in last i gave condition that sale amount >= transpose of incentive model price amount but it give me error