1

I have this table of currency rates: enter image description here

I would like to create a formula that receives the begin date and end date + currency, and in return will calculate the average for every month inside the range.

For example, if the currency is GBP, begin date is 15/09/2015 and end date is 20/11/2015, I would like to calculate averages for 30/09/2015 + 31/10/2015 + 30/11/2015.

I tried to solve it with a simple Average + Vlookup + Match functions, but it wouldn't get me the range of cells but only the edges of the range. I also thought of using AverageIF function, but I'm not sure how to combine between the criterias of date and currency.

Can you think of an easy way to solve that?

1
  • Are you matching on currency, month and year basically ? Commented Mar 27, 2016 at 9:03

2 Answers 2

1

I suggest using an index/match to get a reference to the beginning of the range of currencies then another one to get the end of the range and combining them like this:-

=AVERAGE(INDEX($B$2:$H$10,MATCH(D13,A$2:A$10,0),MATCH(1,(MONTH(E13)=MONTH($B$1:$H$1))*(YEAR(E13)=YEAR($B$1:$H$1)),0)):
INDEX($B$2:$H$10,MATCH(D13,A$2:A$10,0),MATCH(1,(MONTH(F13)=MONTH($B$1:$H$1))*(YEAR(F13)=YEAR($B$1:$H$1)),0))
)

Where the currency name is in D13, start date in E13 and end date in F13, and the table is in A1:H10.

Result: 1.5203

Must be entered as an array formula using CtrlShiftEnter

Sign up to request clarification or add additional context in comments.

Comments

0

Found a way to solve this, by using the AVERAGEIF function. Enjoy, and thanks for helping!

enter image description here

1 Comment

Yes good but I think you need to put 6/8/2015 in as a date(2015,8,6) like you did with date(2016,1,31).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.