Wow, that works absolutely fine. Thanks for the help.
However, I was wondering why this can't be done with "Averageif" or "aggregate" function. I was trying to get the output on my own using either of these functions last night.
As a part of learning, I would like to know if there is another methods of doing this.
Thanks for the help Haz.