Column A is the year. Column B is the corresponding interest rate for that year. This Data runs from A4:B35. In column N is a particular start year, and column O is a particular end year. What I need in Column P is the average between from the year in N to the year in O, which I want to be pulled from A4:B35.
Example
A B N O P
1980 5.0 1981 1982 Need average from B2:B3 here
1981 6.0 1980 1982 Need average from B1:B3 here
1982 5.5 1982 198x Need average from B3:Bx here
The columns in between these will be user entered. Then the spreadsheet will pull column N and O from what was user entered. So I need the formula in column P to be able to pull the average from any possible range of years that are available in A4:A35. So I need to be able to average A6:A8, A10:A20, A4:A30, etc. I've been able to get a cell address using an array formula, but that does me no good because the address cannot be used within another forumla.
If it matters, this will be averaged for the total year, i.e. 5.0%*365 days + 6.0%*365 days, etc. As always, this things make plenty of sense in my head, but may be confusing. Let me know if you need more information.
I apologize but I cannot post the file. I will work on creating a similar copy in case its needed.
Copus1221,
Welcome to the forum!
I see you have Excel 2007 listed as your version, so the formula you're looking for is the AverageIfs() formula.
In cell P4:
=AVERAGEIFS($B$4:$B$35,$A$4:$A$35,">="&N4,$A$4:$A$35,"<="&O4)
And then copy down. Is that something you can work with?
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
So far so good. Thanks for your quick response! I will let you know if I run into any issues.
And thanks for the welcome!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks