I am trying to get the average value(s) of some specific entries. I have two columns: A-which is an index column (it goes e.g. from 1 to 1000) and B which is the values column. 

I know there is an AVERAGE function and there is an AVERAGE IF function, which will probably help me but I can't seem to get it working the way I need to. 
What I need to do is to get the average value of the entries in column B that match this description for the index in column A: 3 + (3\*n) in which n >= 0. In this case I need the average of the values in column B, whose entries in A are 3, 6, 9, 12, 15... 

Is it possible to do this with excel or do you think it would be better to write a program to get those values?

Thanks for your tips!!

-Jordi