Summing specified intervals

pssureshbabu

New Member
Joined
Oct 5, 2006
Messages
16
Auswertung_2_test.xls
MNOPQR
2525DeltaEpsilon
26100000
270-10%10.100.1
2810-20%20.20.10.2
2920-50%50.60.20.3
3050-100%1010.30.4
310.40.5
320.50.6
330.60.7
340.70.8
350.80.9
360.91
3711.2
381.21.4
391.41.6
401.61.8
411.82
4222.6
432.63.2
443.23.8
453.84.4
464.45
4756
4867
4978
5089
51910
Daten


I have around 5000 values ranging from 0 to 10 in ascending order as given in cell M26. Sub task is to reduce the 5000 values down to user defined number of values in this case user input is 25 as in cell M25. After calculating the difference for each % intervals as in column O, how do I write formula to fill automatically my Column R? Here I did it manually by comparing the column N and O.

Thanks for your help!

Babu
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

pssureshbabu

New Member
Joined
Oct 5, 2006
Messages
16
Guys, I need a macro to do the following for the above mentioned problem.

Start a cell with value = "O27"
And then go to next cell in the column which = O27+R27
Do this until the cell value = N27
Then go down the next cell which = O28 + R36
Do this until the cell value = N28
Then go down the next cell which = O29 + R41
Do this until the cell value = N29
....
....
...

I hope this time I made my question bit clearer. Please help with VBA macro loop!!!!!!!

Thanks
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Put this formula in R28 and fill down:

=R27+IF(COUNTIF($N$26:$N$30,R27)>0,INDEX($O$26:$O$30,MATCH(R27,$N$26:$N$30,1)+2,1),INDEX($O$26:$O$30,MATCH(R27,$N$26:$N$30,2)+1,1))

Denis
 

pssureshbabu

New Member
Joined
Oct 5, 2006
Messages
16
Sub test()
Dim EndRow As Integer
Dim StartRow As Integer
Dim i As Integer

StartRow = 4
EndRow = StartRow + [a2].Value - 1
j = 4
For i = StartRow To EndRow
If Cells(i - 1, "F") < Cells(j, "B").Value Then
Cells(i, "F") = Cells(i - 1, "F") + Cells(j, "C").Value
Else
j = j + 1
Cells(i, "F") = Cells(i - 1, "F") + Cells(j, "C").Value
End If
Next i
End Sub

This is the thing I needed. Anyhow thanks for everybody who looked into this problem.
 

Forum statistics

Threads
1,141,630
Messages
5,707,520
Members
421,512
Latest member
jc364698

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top