Finding the average of multiple (broken up) cells using a function

JBACH92

New Member
Joined
Nov 7, 2015
Messages
12
Hi all, just been racking my brain on this one for a while. I am trying to get an average of the last 6 months (from the previous month: ex: if it's November then May-October) of data in this list the only thing I can think of is a whole bunch of nested "IF(MONTH(TODAY())=11, AVERAGE(blah:blah, blah:blah), ...) There has to be an easier way to do this I keep loosing track of the numbers and dates and all.
JAN
12%
FEB
37%
MAR
26%
APR
102%
MAY
87%
JUN
16%
AUG
12%
SEP
82%
OCT
59%
NOV
18%
DEC
31%
12MONTH
40%
6 MONTH
??%

<tbody>
</tbody>


Thank you in advance!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
1JAN12%12months in table
2FEB37%
3MAR26%I want the average of the last6monthswhich is months7to 12
4APR102%
5MAY87%
6JUN16%col D is populated with 1's if in chosen date range
7JUL33%1
8AUG12%1
9SEP82%1AVERAGE =39.17
10OCT59%1
11NOV18%1
12DEC31%1
I want the average of JUNtoOCT
these are month6to10which is5months
average =40.40
if this works for you I will post the formulas

<colgroup><col width="64" span="18" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
You are close, I am looking to be able to open the excel file and it to calculate the past 6 months of data from "todays" (that day's) month. So for example I open the file on Nov 16th then it should compile the average of months JUN to OCT as in the respective previous month. I hope I explained it better and if that is what you were asking then I must be more confused than I thought :confused:
 
Last edited:
Upvote 0
I think where my issue lies is when the current month is for example February it's not as simple as AVERAGE(C?:C?) I am looking for a way to average August to January considering the current month is February still for example.
 
Upvote 0
1JAN12%
2FEB37%
3MAR26%1
4APR102%1
5MAY89%1let us assume that today is27/09/2015
6JUN16%1so the month isSep
7JUL33%1the month number is9
8AUG12%1so start month number is3
9SEPso end month number is8
10OCT
11NOVnote - Sep, 9,3,8 are all calculated automatically
12DEC
note also - the 1's in column D are calculated automatically
last 6 months average % is46.33
(I changed the may % to avoid a no decimal place answer
for testing purposes)
formula giving 46.33 is
=100*SUMPRODUCT(($C$2:$C$13)*($D$2:$D$13=1))/6
if the date in J6 (27/09/2015) is replaced by =today() then the last 6 month ave in J17 will always be correct

<colgroup><col span="9"><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
Ok, so that does work although there's one issue. I don't want those 1's to be there as in I don't want to have to put them in. Below is a mock of the table "not actual values". All these numbers are references to completely separate documents that are updated monthly. My job is to get the values from each document (doc1 values => col A, doc2 values => col B, doc3 values => col C) and compile them all into this worksheet. I just want to update the documents where I am getting the values from and just print this worksheet without editing it.

MONTHABC
JAN12%10022%.35%
FEB37%16503.86%
MAR26%2800%.92%
APR102%4528%.86%
MAY89%1832%.83%
JUN16%802%.12%
JUL33%3256%.03%
AUG33%41%.94%
SEP12%1247%.67%
OCT82%3111%.32%
NOV18%4015%.72%
DEC31%1218%.41%
6 MONTH44%1715%0%
12 MONTH41%4115%1%

<tbody>
</tbody>



Saying this is the table I have above; the 6 MONTH cells need to have the average of the past 6 months the aforementioned files are being updated (in other words the current month it would be I have this document open) and I want to do this in a formula without adding any extra cells. Don't mind the values below much because they change monthly I'm worried more about the formula for the 6 month average.

EX: (I'm updating these documents in November):

values used are in blue


MONTHABC
JAN12%10022%.35%
FEB37%16503.86%
MAR26%2800%.92%
APR102%4528%.86%
MAY89%1832%.83%
JUN16%802%.12%
JUL33%3256%.03%
AUG33%41%.94%
SEP12%1247%.67%
OCT82%3111%.32%
NOV18%4015%.72%
DEC31%1218%.41%
6 MONTH44%1715%0%
12 MONTH41%4115%1%

<tbody>
</tbody>




EX: (I'm updating these documents in February):

values used are in blue

MONTHABC
JAN12%10022%.35%
FEB37%16503.86%
MAR26%2800%.92%
APR102%4528%.86%
MAY89%1832%.83%
JUN16%802%.12%
JUL33%3256%.03%
AUG33%41%.94%
SEP12%1247%.67%
OCT82%3111%.32%
NOV18%4015%.72%
DEC31%1218%.41%
6 MONTH44%1715%0%
12 MONTH41%4115%1%

<tbody>
</tbody>
 
Upvote 0
But there's no way to do this without changing the 1's every month? There has to be a way to do set this up so it can just do the calculations based off the current month. "MONTH(TODAY())"
 
Upvote 0
I do not type the 1's in - they appear according to your month selection or the current date if you are going for last 6 months.......
 
Upvote 0
So how are the 1's calculated based off the month then? Where are the formulas for those cells?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,102
Members
449,205
Latest member
ralemanygarcia

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