View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic[_2_] Domenic[_2_] is offline
external usenet poster
 
Posts: 265
Default Find the last row using 2 to 20 criteria

Assuming that A1:W205000 contains the data, and Y1:AJ1 contains the 12
chosen numbers, try...

=MAX(IF(MMULT(ISNUMBER(MATCH(A1:W205000,Y1:AJ1,0)) +0,TRANSPOSE(COLUMN(A1:
W205000)^0))=COUNT(Y1:AJ1),ROW(A1:W5000)))

or

=MATCH(TRUE,MMULT(ISNUMBER(MATCH(A1:W205000,Y1:AJ1 ,0))+0,TRANSPOSE(COLUMN
(A1:W205000)^0))=COUNT(Y1:AJ1),0)+ROW(A1)-1

Note that these formulas need to be confirmed with CONTROL+SHIFT+ENTER.

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

In article ,
Minister wrote:

The worksheet looks like this:

Column A Column B Column C

1 3 21
5 8 26
16 21 37
1 19 49
2 37 41
3 21 51

The actual worksheet features 23 columns like the ones depicted above (A,
B, C),
and also features 205,000 rows of data.
However, you may want to answer only in regards to the smaller table
found above-and we'll take it from there.

The question:
How does one find the last row featuring say, the numbers 3 & 21?
In the example above, the last row is row 6.

Note the following:
Whatever formula is to be used CANNOT use a single column as its
reference. This because, any number can appear in any column.
Ex: The number 3 may appear in either column A, B or C (and actually in
another 21 columns of the actual worksheet).
Also, instead of finding a row featuring only 2 numbers (Ex: numbers 3
& 12), there needs to be a way of also finding the LAST row featuring up to
12 chosen numbers. Ex: Find which is the last row which contains the
following numbers:
1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16.
Lastly, we are using Office 2007 (using multiple cores) and a very
powerful, quad-core cpu; this, in reference to the power demand of using such
array formulas...
Any assistance will be greatly appreciated.

P.S. The closest we've come to the answer looks like this (Array formula):
=MAX(IF((A1:A6=3)*(A1:C6=21),ROW(A1:C6),"")).

This formula would work if the number 3 appeared only under column A...

HOWEVER: This formula will not work because the reference to the first #
(number 3) is made only in regards to column A. Instead, it should've refered
to A1:C6-which is impossible in this formula.