View Single Post
  #3   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

Try...

=IF(AW7<"",INDEX(ID,MATCH(2,1/((OFFSET(INDEX(Data,0,2),,,ROWS(Data)-1)=T
EXT(AW7,0))*(OFFSET(INDEX(Data,0,2),1,,ROWS(Data)-1)="")))),"")

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article <78e69a99cec71@uwe, "Sam via OfficeKB.com" <u4102@uwe
wrote:

Sample Data Layout:
ID, Col1, Col2, Col3,
1300, EmptyText,1, EmptyText,
1301, 00, EmptyText,EmptyText,
1302, 0, 1, EmptyText,
1303, 0, 1, EmptyText,
1304, EmptyText,1, 2,
1305, 00, EmptyText,2,
1306, 0, EmptyText,EmptyText,
1307, 0, EmptyText,EmptyText,
1308, 0, 1, EmptyText,
1309, EmptyText,1, 22,

NB: Commas separate the columns.

1) Match specific Text for Column2
- Single occurrence of Text value "1"

2) Match varying sequential numbers of EMPTY TEXT rows
- Match zero EmptyText row after / below single occurrence of Text value one
"1".
this means two sequential instances of text value "1".

3) Return previous / penultimate MATCH of the above (1 & 2).
- Return previous / penultimate match of single instance of Text value one
"1" with zero EmptyText row below it.

Expected Result ID 1304.

Cheers
Sam