View Single Post
  #1   Report Post  
Joseph Spain
 
Posts: n/a
Default OFFSET function question

Today, I'm having a small problem that I cannot find a solution for.

If you have time... Here's the basic model in simple terms... The formula
I am seeking will reside in cell C1, and the answer to the problem below
should be 1.

.....A...B...C
1...9...1...1
2...4...5...
3...9...1...
4...4...6...

Explanation:

I am attempting to find the largest two numbers in range A1:A4 (which are
9 and 9 in my example). Then, I need to average the *corresponding* cells
in column B. In my example, the values I want to average are located in
B1 and B3 because they are located on the same rows as the two largest
numbers in range A1:A4.

I can use the formula...

{=AVERAGE(LARGE($A$1:$A$4,ROW(INDIRECT("1:2"))))}

....to locate and average the largest two numbers in range A1:A4, but when
I try to use OFFSET to average the adjacent cells in column B, my
formula...

{=AVERAGE(LARGE(OFFSET($A$1:$A$4,0,1),ROW(INDIRECT ("1:2"))))}

....averages the largest two numbers in range B1:B4, which does not provide
me with what I require.

Does anyone see how I can receive the correct solution from column B? The
formula will reside in cell C1 and the answer should be 1.

Thanks very kindly.

Best Regards,
Joseph