View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default minimum and the corresponding value

=IF(ISERR(SMALL(IF((rngC-rngB)=MIN(rngC-rngB),ROW(INDIRECT("1:"&ROWS(rngA)))),ROWS($1:1))) ,"",INDEX(rngA,SMALL(IF((rngC-rngB)=MIN(rngC-rngB),ROW(INDIRECT("1:"&ROWS(rngA)))),ROWS($1:1))) )

ctrl+shift+enter, not just enter
copy down


"dinesh kumar" wrote:

hi ,
can any help with VBA code for the below case IN EXCEL


A B C
X 3 8
Y 5 10
Z 10 20


I WANT THE MINIMUM OF C-B AND ALSO THE VALUE CORRESPONDING TO THE
MINIMUM
MY OUTPUT SHOULD LOOK LIKE
THE MINIMUM OF B-C IS 5 AND THE VALUES ARE X AND y