How to determine the value?

E

Eric

Referring to the post in General Question

Does anyone know on how to determine the value in following case?

In cell A1 = 10 In cell B1 = 12
In cell A2 = 15 In cell B2 = 17
In cell A3 = 20 In cell B3 = 23

I would like to determine which pair [A & B] will be the minimum difference,
let take the abs of the difference in order to avoid negvative results. In
this case, abs(12-10) = 2 and abs(17-15) = 2, there are 2 pairs of value to
meet the minimum difference between A & B columns. Then I would like to
determine the minimum median value from those pairs, in this case (12+10) =
11, then the 11 will display in cell C1. Does anyone have any suggestion on
how to do this calculation in excel?
Thank you in advance
Eric Choi
 
T

T. Valko

Try this:

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=MIN(IF(ABS(A1:A3-B1:B3)=MIN(ABS(A1:A3-B1:B3)),SUBTOTAL(1,OFFSET(A1:B3,ROW(A1:B3)-1,,1,2))))

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top