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!
 
Here is what I have now

JAN=IF(AND(C5<=6,I3<>1),1,0)
FEB=IF(AND(C5 <= 7, I3 > 2), 1, 0)
MAR=IF(AND(C5 <= 8, I3 >3), 1, 0)
APR=IF(AND(C5 <= 9, I3 > 4), 1, 0)
MAY=IF(AND(C5 <= 10, I3 > 5), 1, 0)"CURRENT MONTH"
JUN=IF(AND(C5 < 11, I3 > 6), 1, 0)
JUL?
AUG?
SEP?
OCT?
NOV?
DEC?

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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
formula in cell marked #####
=IF(AND(A8>$O$4-1,A8<$Q$4+1),1,"")
A8 is the 7 to left of july
O4 is the 7 to the right of the word months
Q4 is the 12 to the right of the 7
formula in O4=N2-6+1
formula in N2 (12)=COUNTA(B2:B101)(counts how many months in table)

<colgroup><col width="64" span="18" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
JAN12%12%
FEB37%49%
MAR26%to get the last 6 months75%
APR102%it will always be the last 6 rows in the table177%
MAY87%264%
JUN16%the helper column on the right is a running280%
JUL33%total of the percentages313%
AUG12%325%
SEP82%407%
OCT59%466%
NOV18%so the 6 month total is the biggest484%
DEC31%% minus the 7th biggest %515%
515%=LARGE(M7:M50,1)
280%=LARGE(M7:M50,7)
take one from the other and divide by 6

<colgroup><col width="64" span="13" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
we are getting toooooo complicated - over tea and biscuits this came to me:-

JAN12%
FEB37%
MAR26%
APR102%
MAY87%
JUN16%47%
JUL33%50%
AUG12%46%
SEP82%55%
OCT59%48%
NOV18%37%
DEC31%39%the last one - 39% formula is =SUM(E41:E46)/6

<colgroup><col width="64" span="13" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
So essentially I'm still going to have to go back to the whole list of "IF" statements then.

"JAN is cell D36 for instance then" and my result cell (showing the 6 month average) below has:

=IF(MONTH(TODAY())=1, SUM(E41:E46)/6, IF(MONTH(TODAY())=2, SUM(E36, E42:46)/6, IF(MONTH(TODAY())=3 SUM(E36:E37, E43:E46)/6..........IF(MONTH(TODAY())=12, SUM(E40:E45)/6

^The above line is what I was trying to avoid but I'm having a difficult time understanding what you're trying to have me do. And used to be a computer programmer I just don't get along with excel well is all please break it down into what I can put into one cell to compute the previous 6 months from a given date in lamens terms.
 
Upvote 0
Ok, I hope you are not getting frustrated with me because I'm just not following somehow. :( These values for the months are going to be changing monthly when the other documents are being updated. I'm trying to explain as best as possible, I really am.

Basically this is what is going on:

Doc 1, 2, and 3 have information that is being changed daily.
Doc 4 is the one I am dealing with monthly (this being the one we have been talking about)
In December, I want to open this file and say print and close it. No changing formulas or anything.

From what I understand from your post 17 is you think I always want the last 6 months of the year. No. I am looking for a formula to get the AVERAGE of the previous 6 months values from in December, then in January when that comes. These values and the months values and averages will change every time I open the document to print. But I just want to open this spreadsheet and click print and have that done.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,843
Members
449,471
Latest member
lachbee

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