Need some assistance. Im fairly good with formulas as well as excel but this one seems to keep tripping me up.
I am trying to figure out a formula that will add the numbers in a row to be added up until the number changes. When it does change then begin adding those numbers up until it changes again....and on and on and on.
So the conditions of the number are based on the two adjacent numbers. So if it help here are the only possible combinations (111,113,133,333,331,311). Also, in the entire worksheet, the first and last numbers will always be a 3.
Here in lies the problem or rather several problems.
The numbers are either a 3 or a 1. EX--> 3 3 3 3 1 1 1 1 3 1 3 3 1 1 1 1 1 3 Now using this as the example here is what I have been trying for the last several days to do....
Part one:
1. Count (add up) the 3s until you get to a one. Once the number changes to a one then add 1 to the sum of the threes. Even if it a 3 between two 1s. So 3 3 1 3 1 3 3 3 1 3 would come out to 7 1 4 1 10 1 4
2. Do the same for the 1s except do not add an additional 1 to the total.
Using these conditions the end result should look like this for the example above 3 3 3 13 1 1 1 4 4 1 3 7 1 1 1 1 5 4
Part two:
Here is where is get's a little complicated too....(If this makes it a little bit more complicated then I can do without it but it would be great if it was possible.)
1. Once the math is done I need all of the numbers that are still a 3 or 1 to the left of a large number to be changed to a zero without affecting the calculations from part one. Taking in to consideration that the total of the 1s might be a 3.
2. In between each total I would like to insert the letters d or s and a comma (xd, xs, xd, xs (with x being the number))
So once all is said and done the example would look like this --> 0 0 0 13 0 0 0 4 4 0 1 0 7 0 0 0 0 5 4
Any help will be greatly appreciated.
Bookmarks