moving average

nhoe1957

New Member
Joined
Aug 8, 2010
Messages
13
Hi
I'm new here

Thanks for the help

I know how to do the normal moving average.

But I am interested in only having the last moving average shown.

example below, I want let's say the last 5 day's MA to display in the XXXXX
and as I add data, 7-20, 7-23, 7-24, etc. that the MA XXXXX automatically updates in that cell ONLY. I am not interested in viewing the past MAs. Only for the most current data.

MOVING AVERAGE
XXXXX

data set

date $

7-10 100
7-11 20
7-12 50
7-13 -20
7-14 250
7-17 -100
7-18 50
7-19 65
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
okay now is this possible.

I'm using Matty's formula

=AVERAGE(OFFSET(B1,MATCH(9.99E+307,B:B),0,-6,1))


new situation.

Is it possible to have a 5 day moving average calculate the LAST 5 numbers = inputs?

This is because not everyday there is a number or value.
example would be

date Value 1 Value 2 Value 3
5-10 .....10.... 5........ 2
5-11 .....9................. 3
5-12.... 8........ 6....... 2
5-13 .....12...... 5
5-14 ...............9...... 4
5-15 ...11................. 3
5-18 ....9........ 5....... 5

5dayMA 9.80..... 6.0...... 3.4

currently with this formula, if I am missing a day or value, the 5 day MA is an invalid number.

thank you in advance.
 
Last edited:
Upvote 0
Excel Workbook
ABCD
1DateValue 1Value 2Value 3
210-May1052
311-May93
412-May862
513-May125
614-May94
715-May113
818-May955
9
105dayMA9.86.03.4
...
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.<br>
 
Upvote 0
so if I am adding data everyday, i.e. May 19, 20, 21, etc.

the formula should be =

={SUM(IF(ROW(B:B)>=LARGE(IF(B:B>0,ROW(B:B),""),5),B:B))/5}

thank you
 
Upvote 0
You would have to use a defined range. It wouldn't work with referencing the entire column. The defined range can be larger than your current data to accommodate additional future entries; e.g.
=SUM(IF(ROW(B2:B100)>=LARGE(IF(B2:B100>0,ROW(B2:B100),""),5),B2:B100))/5

This formula can't be within B2:B100
 
Upvote 0
Hi AlphaFrog

question, does this work if the data or numbers are negative?

I tried it but when I enter negative numbers, or losses, it didn't work.
Am I doing something wrong?
 
Upvote 0
Try something like this...

=SUM(IF(ROW(B2:B8)>=LARGE(IF(B2:B8<>"",ROW(B2:B8),""),5),B2:B8))/5
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top