Hi Bo,
clear now. One workaround for not using long and still average them in the conventional way is the following:

Code:
RawData[0] = 0
for DatSort = 4 to 11                               ' pick out middle 8 readings
RawData[0] = RawData[0]  + (RawData[DatSort] - RawData[3])    ' extract the total difference
NEXT DatSort
RawData[0] = RawData[0]  >>3               ' average the total difference
DatAvg =  RawData[0]  + RawData[3]       ' add the average difference to the subtractor
Return
You addup in RawData[0] all the differences , then you average them and finally you add them to the RawData[3], the subtractor.

Al.