View Single Post
  #10   Report Post  
Harlan Grove
 
Posts: n/a
Default

Ron Rosenfeld wrote...
....
So, being lazy, I would just use a VBA routine to accomplish the task, if you
need it for a 2D reference.

....

VBA unnecessary.

To return the topmost match in rng,

=CELL("Address",INDEX(rng,MATCH(TRUE,COUNTIF(OFFSE T(rng,ROW(rng)
-CELL("Row",rng),0,1,),MAX(rng))0,0),MATCH(MAX(rng ),INDEX(rng,MATCH(TRUE,
COUNTIF(OFFSET(rng,ROW(rng)-CELL("Row",rng),0,1,),MAX(rng))0,0),0),0)))

To return the leftmost match in rng,

=CELL("Address",INDEX(rng,MATCH(MAX(rng),INDEX(rng ,0,MATCH(TRUE,
COUNTIF(OFFSET(rng,0,COLUMN(rng)-CELL("Col",rng),,1),MAX(rng))0,0)),0),
MATCH(TRUE,COUNTIF(OFFSET(rng,0,COLUMN(rng)-CELL("Col",rng),,1),MAX(rng))0,0)))

Both are array formulas. I will admit that if the final result is a
text address, then ADDRESS does give shorter formulas.

Topmost:
=ADDRESS(INT(MIN(IF(rng=MAX(rng),ROW(rng)*1000+COL UMN(rng)))/1000),
MOD(MIN(IF(rng=MAX(rng),ROW(rng)*1000+COLUMN(rng)) ),1000),4)

Leftmost:
=ADDRESS(MOD(MIN(IF(rng=MAX(rng),ROW(rng)+100000*C OLUMN(rng))),100000),
INT(MIN(IF(rng=MAX(rng),ROW(rng)+100000*COLUMN(rng )))/100000),4)

Both array formulas.