hey newbie on iterations.
I have a table like the one below
From Qty Price
0 0,08
1500 0,07
2000 0,06
2500 0,05
Now I need to find the rigth price for, let's say, the quantity of 2600.
Therefore, for the first quantity of 1499, the price is 0,08 with a total of 119,92.
The second quantity of 500 (1500 - 1999), the price is 0,07 with a total of 35.
The third quantity of 500 (2000 - 2499), the price is 0,06 with a total of 30.
The fourth quantity of 100 (2500 - 2600), the price is 0,05 with a total of 5.
Now how do I write a piece of code that capture this structure :?:
Thanks Ann
Comments
And a small function in which I give the quantity and a temptable that will be filled up.
And this is the result for for a quantity of 2600:
And this means that your calculation was wrong [-X
Controlling :
Your quantities (1499+500+500+100) and that makes a total of 2599.
My quantities (1499+500+500+101) and that makes a total of 2600.
But your problem is solved
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!