Forum Discussion
Simpel moving average STOCKHISTORY into single cell
Hi all!
I'm trying to find an easy solution for implementing simpel moving averages for a large amount of stocks. I'm using excel 365 insider. This version has the STOCKHISTORY function included. I'm looking for a way to process the closing prices and average them into a simpel moving average.
The attached excel already has the following:
B6: STOCKHISTORY with manual ticker and start- & end dates.
E6: STOCKHISTORY function with referenced ticker and automatic data for the last 320 days
H6: STOCKHISTORY (same as above), but now sorted in a way so that the latest data is on top of the list.
K6: Almost what I'm looking for. This cell shows the average the full column. Since I'm looking for a simpel moving average, I'd like to set a reference (30, 50 or 200), and use this value to average 30, 50 or 200 cells instead of the full column.
The STOCKHISTORY function only shows data from business days and excludes national holidays. Which is pretty neat. So the selection of how many values to average should be executed after the STOCKHISTORY function. I'm using 320 days to be safe.
Looking forward to your replies.
Thanks in advance!