In the version I posted, the slab lookup data are defined as variable "slab" located in the range $E$3:$H$10, It sounds as if the range will now be something like slab,$E$3:$G$10. Consider this to be a mini-table, so column E has a column index of 1, column F is 2, column G is 3, and column H is 4. The rest of formulas reference the columns like this.
Because each Customer Name might have different slab tiers and commission rates, we need to extract just the portion of the main "slab" table that applies to that particular customer. So "cslab" does this by applying a FILTER to "slab", and it requires CHOOSECOLS(slab,1)=A3, meaning that the Customer Name in "slab" column 1 (that's actually column E) matches the name in cell A3. In the example, cell A3 is customer A, and the resulting cslab lookup table will be:
A | 0 | 10000 | 0.02 |
A | 10001 | 50000 | 0.03 |
A | 50001 | 125000 | 0.04 |
A | 125001 | | 0.05 |
The 3rd column here (original column G labeled "End Slab") is used to create a new array for the "Start Slab" that begins at 0 and adopts all of the existing end slab tier values as the start slab values. This adjustment addresses a problem with the way the original slab tiers are defined. For example, if a lookup value of 10000.5 is given, the original table cannot place that value in any of the tiers because it exceeds the "end slab" value of 10000 of the first tier, but it is below the "start slab" threshold of 10001 for the second tier. What I've just described is performed in this step for variable "csslab"...Customer specific start slab...VSTACK(0,DROP(CHOOSECOLS(cslab,3),-1))
and it converts this End Slab...
to this new Start Slab...
So if your End Slab remains in the 3rd column position, no change is necessary.
Similarly, the Commission column in "cslab" is assigned to the variable named "ccom" and is defined as CHOOSECOLS(cslab,4)...the 4th column. If Commission is now in the 5th column of E:I, the "4" should be changed to "5"...otherwise it remains as "4". Can you post a small example of what the new table structure looks like?