I have three columns "SAMPLE ID" Results , Average
Eg:
SAMPLE ID
1201
1201
1201
1201
1300
1300
1300
1300
1400
Results
400
490
340
400
400
490
233
400
290
I used the following formula to get the average in column 3. I want to this to be done in vba. My data set is long (only few are shown)
- Can I fill this formula down to other cell using vba (even without typing it in the first cell)
2.can we define this as a string and copy it down??? all the helps are appriciated. or any other way of coding to this Thanks
= IF(A2<>A1,AVERAGEIF(A2:INDEX($A2:INDEX(A:A,MATCH(1E+99,A:A)+1),MATCH(TRUE,(INDEX($A2:INDEX(A:A,MATCH(1E+99,A:A)+1)<>A2,)),0)),A2,B2:INDEX($B2:INDEX(B:B,MATCH(1E+99,A:A)+1),MATCH(TRUE,(INDEX($A2:INDEX(A:A,MATCH(1E+99,A:A)+1)<>A2,)),0))),"")