Search code examples
excelmoving-averagevisual-studio-macrosvba

incremental average using excel


I need to take the average of every 2 point increment, my data is in columns "a", as an example , and the average in column "b"

a1 b1=0
a2 b2=a1
a3 b3=average(a1,a2)
a4 b4=average(a2,a3)
a5 b5=average(a3,a4)
...

I need an excel formula or macro to do so , any ideas?


Solution

  • Assuming you want to do it once and not write a macro for it, try this: Enter in CELL B3: =(a1+a2)/2 en drag this down to the end of your rows.