I have a set of data that includes columns with data and columns with "markers". The data is the summation of measurement values and the marker value A shows at which point in the column the summation starts again from 0. Then there is in the marker column a marker value B which shows that a set of summations is finished.
I need to take all the summation values (marked with A) of one set (end marker B) and sum them up. As there a a lot sets of summations I do not want to do it "by hand". Is there a script based solution?
(I know that if the summations occured in defined rows I could simply say: sum up column G from 1 to 5 and 6 to 10, but it isnt that easy.)
(G)(H) 1 x 3 x 4 A 1 x 2 A 1 x 2 x 4 B 1 x 3 x ....... Need: sum (if H includes A or B take value from G, but only until B, then start again from 0)
range rad = 1; range ras = 2; total = 0; loop(ii,1,rad.GetSize()) { if(ras[ii]$=="A") total += rad[ii]; if(ras[ii]$=="B") { total += rad[ii]; col(3)[ii] = total; total = 0; } }