Thank you for putting this complicated formula together you must be a whiz. I am certainly not at your level. and do have some dumb questions...
what does a_1 refer to? And when you display x values which one in particular? Also you have a_2,MAP (subtraction,....what do you mean here?
Also, do I apply this formal to each cell i.e., b12, c12, d13, and so on? Apologies this is interesting what you have put together..and I love to understand it more.
Hello, I will try to explain:
LET function allows us to define a name for any part of a formula and use the name as a shortcut of that particular part; the name could have a meaning or be just a "randomly" chosen chain.
So, "subtraction" represents the result of subtraction of cumulative amount and monthly amount. The idea behind it is to verify whether the whole monthly amount belongs to the same interval or not (more on that later), i.e. whether the relevant monthly amount needs to be distributed or not.
a_1 (a chosen, "random" name) returns the lower bound of the interval into which the cumulative amount belongs in a particular month, a_2 does the same for "subtraction" (cf. above).
Based on a_1 and a_2, b_1 and b_2 assign the relevant cost corresponding with the particular interval.
The letter "c" verifies whether identified lower bounds (i.e. a_1 and a_2) are the same or not, i.e. whether there is a need to apply only one cost or two costs.
Based on "c", d_1 and d_2 distribute the relevant monthly amount, i.e. calculate the amounts where there is only one cost applied and where there are two costs applied.
The last part of the formula multiplies d_1 and d_2 amounts by the respective costs.
As far as "x" is concerned it represents every value of "cumulative" and "subtraction"; as for the "do I apply this formal to each cell i.e., b12, c12, d13, and so on?" part I am not sure what is the answer because I do not know which data you have in those cells; but generally speaking the formula should calculate for the whole row at once (January - December).
You can check what every part of the calculation does if you name the last part of the formula, e.g. z,(b_2*d_2)+(b_1*d_1), and then use any name behind it, i.e. z,(b_2*d_2)+(b_1*d_1),a_1 will return a_1 part of the calculation and so on.
I now realize that I have not considered a situation if the monthly amount is so high that it belongs to three (or more) intervals; so, a) is it possible? b) if yes, how the calculation should proceed?
Also, one more thing to be addressed is that the intervals should be continuous (at the moment there is a gap between 251000-300000 and 351000-400000) + it would be easier (as far as formula construction is concerned) if you could also set the top limit (e.g. some high number like 1 billion).
So, I guess this is not a finished story yet