View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tpeter tpeter is offline
external usenet poster
 
Posts: 74
Default vlookup then average 3 above and below

Thank you for your help, this will get me close with some tweaks. I
appreciate you pointing me in the right direction.

"T. Valko" wrote:

I am guessing that is what the -4 is?


Yes. You want to calculate 3 cells on either side of the lookup_value for a
total of 7 cells. The -4 finds the cell that is 3 on the top side of the
lookup_value. So, the average starts from that cell and averages the next 6
cells for a total of 7.

Where this would be a problem is, based on your posted sample, if the
lookup_value was say 1.1. There aren't 3 cells on either side of 1.1. There
are no cells on the top side. That's why I noted:

Assuming that there will *always* be 3 cells on either
side of the lookup value:



--
Biff
Microsoft Excel MVP


"tpeter" wrote in message
...
I am not very familar with the offset and match functions, but this lookup
is
for a series of data that is plotted so there is no blank cells on either
side of the lookup. I am guessing that is what the -4 is? Sorry for being
a
pain.

"T. Valko" wrote:

Assuming that there will *always* be 3 cells on either side of the lookup
value:

=AVERAGE(OFFSET(A1,MATCH(1.4,A1:A7,0)-4,,7))


--
Biff
Microsoft Excel MVP


"tpeter" wrote in message
...
I have 2 colums of data and my vlookup works fine, but I now want it to
find
the value, take the previous 3 data points and the next 3 data points
and
give me the average of these 7 data points. I think the vlookup is the
correct function but I am not sure. her is an example

1 1.1
2 1.2
3 1.3
4 1.4
5 1.5
6 1.7
7 1.8

so if my vlookup found the value of 1.4, I want it to average
1.1,1.2,1.3,1.4,1.5,1.6,1.7, and 1.8 and return that value.

Thank you for any help.