If my data is in cells A1 to A4, I want the same output as this below formula would give.
=MIN(0,A1-1*B1,A1+A2-2*B1,A1+A2+A3-3*B1,A1+A2+A3+A4-4*B1)
Please see the pattern of the RED highlighted part) i.e. first A1, then A1+A2, then A1+A2+A3 then A1+A2+A3+A4. it goes on upto A4. However, if the data is until A10 then it should gone until A10. So it all depends on the length of data in column A.
Also, the constant number to be subtracted is B1 as shown in blue above. B1 is multiplied by the numbers 1, 2, 3, 4, and so on.. (See the highlighted blue pattern (i.e. B1*1 then B1*2 then B1*3 and B1*4.
If the data in column A was upto A10, then the B1 also would have been multiplied until 10*B1
In short:
When it is just A1 then A1 - 1*B2
When it is A1+A2 then the B1 is multiplied by 2
When it is A1+A2+A3 then B1 is multiplied by 3
This is how the pattern is. Please advise a short formula for the same. This will reduce a lot of manual typing for me.
Thanks for all the help that is provided on this forum.
P.S: the Total of A1 to A15 is in cell A16. In case, that could be of any help in making a formula succinct..
Note: The data can go maximum up to A15 only. it will never be more than that.
Please let me know if any additional info is required
=MIN(0,A1-1*B1,A1+A2-2*B1,A1+A2+A3-3*B1,A1+A2+A3+A4-4*B1)
Please see the pattern of the RED highlighted part) i.e. first A1, then A1+A2, then A1+A2+A3 then A1+A2+A3+A4. it goes on upto A4. However, if the data is until A10 then it should gone until A10. So it all depends on the length of data in column A.
Also, the constant number to be subtracted is B1 as shown in blue above. B1 is multiplied by the numbers 1, 2, 3, 4, and so on.. (See the highlighted blue pattern (i.e. B1*1 then B1*2 then B1*3 and B1*4.
If the data in column A was upto A10, then the B1 also would have been multiplied until 10*B1
In short:
When it is just A1 then A1 - 1*B2
When it is A1+A2 then the B1 is multiplied by 2
When it is A1+A2+A3 then B1 is multiplied by 3
This is how the pattern is. Please advise a short formula for the same. This will reduce a lot of manual typing for me.
Thanks for all the help that is provided on this forum.
P.S: the Total of A1 to A15 is in cell A16. In case, that could be of any help in making a formula succinct..
Note: The data can go maximum up to A15 only. it will never be more than that.
Please let me know if any additional info is required
Last edited: