View Single Post
  #22   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic Domenic is offline
external usenet poster
 
Posts: 150
Default MATCH Multiple Criteria & Return Previous / Penultimate Match

With the layout as you described in your previous post, try the
following...

1) Select 'Update Appraisal'!AZ7 and define the following:

ID:

=OFFSET('Site Lond'!$A$12,0,0,MATCH(9.99999999999999E+307,'Site
Lond'!$A$12:$A$65536))

Data:

=OFFSET('Site Lond'!$H$12:INDEX('Site
Lond'!$H$12:$H$65536,MATCH(9.99999999999999E+307,' Site
Lond'!$A$12:$A$65536)),,,,51)

Range:

=INDEX(Data,0,ROWS('Update Appraisal'!$AZ$7:$AZ7))

Array1:

=TRANSPOSE(ROW(INDIRECT("1:"&'Update Appraisal'!$BB7)))

Array2:

=ISNUMBER(MATCH(IF(Range=LEFT('Update Appraisal'!$AX7,LEN('Update
Appraisal'!$AX7)),ROW(Range)+Array1,""),IF(Range=" ",ROW(Range)),0))+0

Array3:

=MMULT(Array2,ROW(INDIRECT("1:"&'Update Appraisal'!$BB7))^0)

Array4:

=ISNA(MATCH(IF(Range=LEFT('Update Appraisal'!$AX7,LEN('Update
Appraisal'!$AX7)),ROW(Range)+'Update
Appraisal'!$BB7+1,""),IF(Range="",ROW(Range)),0))

2) Then enter the following formula in 'Update Appraisal'!AZ7 and copy
down:

=INDEX(ID,LARGE(IF(Array3=$BB7,IF(Array4,ROW(ID)-MIN(ROW(ID))+1)),2)+$BB7
)

Note that this formula needs to be confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!