0

Can anyone solve this problem google sheet fetch google finance and find SMA

I need to find the simple moving average with a condition if J1 is 9 then it has to calculate from E2:E10 and put in G10

google sheet fetch google finance and find SMA

If the given value is 15 then the result has to for 15 periods SMA

While changing the SMA value then the range has to change and given SMA has to result

dgnk
  • 98
  • 8

1 Answers1

1

You can use following formula:

=IF(ROW()=$J$1+1,AVERAGE($A$2:INDEX(A:A,$J$1+1)),"")

enter image description here

basic
  • 11,673
  • 2
  • 9
  • 26