New Contributor

Formula for average using a control source

I am trying to get an average using data stored in cells running across the page. There will be one row of information.  The column headings are the three letter month abbreviation starting with OCT and ending with SEP.  I would like to create a formula that looks at the entire range (columns from OCT - SEP) while disregarding the current month and discounting any '0's.

So for the month of NOV the AVG would be what ever is in the column for the corresponding row in OCT.  Similarly, if we were in JUN the formula would average the data in the columns OCT - MAY.

Would this be an array formula?  Or am I overthinking it?

2 Replies

Re: Formula for average using a control source

=AVERAGE(OFFSET(B1,0,0,100,MATCH(TEXT(TODAY(),"MMM"),B1:M1,0)-1))
assuming:
1. your table starts in B1 and it's 100 rows high
2. "MMM" is the proper short Month format code for your language settings

**ED**

Forgot -1

/**ED**

Re: Formula for average using a control source

@MindreVetandeThank you, and for the ED -- was scratching head as I was getting #N/A error.  It works just right!