
Originally Posted by
ssdt
Hi all,
I basically have a list of several thousand 1s and -1s to sift through (the values represent a direction, 1 being left and -1 being right). The values are periodic, i.e. they go "1,1,1,1,-1,-1,-1,1,1,1,1-1,-1", etc but the period is not regular - in fact, that's what I'm trying to work out.
So in effect, what I need is a loop that will start off reading the cell E4, see that it is "-1", then sum downwards through the E column until it hits a 1, in which case it will save the sum of all -1s to another cell. Then, keep counting the "1"s until it hits a -1, save the number of "1"s to another cell, and so on and so on until it hits a blank or 0 value.
In the end, what I basically need is an ordered list of values, with the positive values in one column, and the negatives in another i.e. A1 = 34, A2=44, B1=-30, B2=-55.
Much gratitude if you can help. My VBA skills are very rusty and I have never worked with it in Excel (only MS Access).
Bookmarks