View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default multi conditional searching

Assuming that A2:C10 contains the data...

Let E2 contain the date of interest, such as 13/4/06

Let F2 contain the number of interest, such as 101

Then try the following formulas...

G2:

=SUMPRODUCT(--(A2:A10=E2),--(B2:B10=F2))

H2, copied down:

=IF(ROWS(H$2:H2)<=$G$2,INDEX(C$2:C$10,SMALL(IF($A$ 2:$A$10=$E$2,IF($B$2:$B
$10=$F$2,ROW(C$2:C$10)-ROW(C$2)+1)),ROWS(H$2:H2))),"")

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article ,
realspido wrote:

Guys,
please help me! I struggle with some problem:
I have a list:
date no code
12/4/6 101 AA
12/4/6 101 AB
12/4/6 102 AA
12/4/6 102 AA
12/4/6 102 AA
13/4/6 101 AA
13/4/6 101 AC
13/4/6 101 AB
13/4/6 102 AA
...
...

I'm trying to generate a list of codes matching to criteria, e.g.:
date no
13/4/6 101
Unfortunately function 'MATCH' can find a record using just one criteria,
and 'DGET' returns #NUM if there's more then one record matching the criteria.
What I need to get is:
AA
AC
AB
e.g. as array. Or if it's not possible at least first of the matching.
Is there any way to do it?
Thanks for any help.