alepaladio
New Member
- Joined
- Apr 27, 2015
- Messages
- 2
Hi everyone, I have an issue, how can you, using excel vba 2010 do a sum of the elements of a column backwards, i have this
[TABLE="width: 240"]
<colgroup><col width="80" span="3" style="width:60pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 80"]Sum[/TD]
[TD="class: xl63, width: 80"][/TD]
[TD="class: xl63, width: 80, align: right"]0.7447[/TD]
[/TR]
[TR]
[TD="class: xl63"]Sum by 1/3[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]0.2482[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0980[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0730[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.2000[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1490[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.2627[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1957[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.1804[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1344[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0863[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0643[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0941[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0701[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0431[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0321[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0235[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0175[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0118[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0088[/TD]
[/TR]
</tbody>[/TABLE]
where value 0.7447 is the sum of last column, and sum by 1/3 is 0.7447*1/3
what I need, is to make a sum, starting from last value in last column (Cells(11,3)), and stop when it is greater than sum by 1/3. I have this...
For i = 8 To 0 Step -1
Cells(11 - i, 4) = i
Next i
this helps me count from 0 to 8 backwards, but I dont know hot to make the cumulative sum, until It reaches 0.2482, please help!
Thanks for your help!
[TABLE="width: 240"]
<colgroup><col width="80" span="3" style="width:60pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 80"]Sum[/TD]
[TD="class: xl63, width: 80"][/TD]
[TD="class: xl63, width: 80, align: right"]0.7447[/TD]
[/TR]
[TR]
[TD="class: xl63"]Sum by 1/3[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]0.2482[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0980[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0730[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.2000[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1490[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.2627[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1957[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.1804[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.1344[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0863[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0643[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0941[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0701[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0431[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0321[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0235[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0175[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]0.0118[/TD]
[TD="class: xl63, align: right"]0.7448[/TD]
[TD="class: xl63, align: right"]0.0088[/TD]
[/TR]
</tbody>[/TABLE]
where value 0.7447 is the sum of last column, and sum by 1/3 is 0.7447*1/3
what I need, is to make a sum, starting from last value in last column (Cells(11,3)), and stop when it is greater than sum by 1/3. I have this...
For i = 8 To 0 Step -1
Cells(11 - i, 4) = i
Next i
this helps me count from 0 to 8 backwards, but I dont know hot to make the cumulative sum, until It reaches 0.2482, please help!
Thanks for your help!