View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default multiple criteria

Another play, using only formulae ..
"array-entered" means to press CTRL+SHIFT+ENTER to confirm the formula

Assume table as posted in cols A to E, data from row 2 to 100
(E2:E100 is assumed fully populated with letter grades)

In F2: =IF(C2="","",IF(COUNTIF(C$2:C2,C2)1,"",ROW()))
In G2: =INDEX(C:C,SMALL(F:F,ROWS($1:1)))
In H2, array-entered: =MAX(IF($C$2:$C$100=G2,$D$2:$D$100))

In I2, array-entered:
=INDEX(A$2:A$100,MATCH(MAX(IF(($C$2:$C$100=$G2)*($ D$2:$D$100=$H2),ROW($A$2:$A$100))),IF(($C$2:$C$100 =$G2)*($D$2:$D$100=$H2),ROW($A$2:$A$100)),0))
Copy I2 to L2. Format L2 as date.

In M2, array-entered:
=CHAR(MIN(IF((C$2:C$100=G2)*(D$2:D$100=H2)*CODE(E$ 2:E$100)0,(C$2:C$100=G2)*(D$2:D$100=H2)*CODE(E$2: E$100))))

Select F2:M2, copy down to M100. Minimize/hide away cols F to H. Cols I to M
should return the required results (from the source data set in A2:E100)
satisfying all of your multiple criteria. Result lines will be neatly packed
at the top, with #Num! errors below (I excluded error trapping here, for
better clarity on what's happening as the core formulas are quite long).

Try the above out, let me know how it went for you.
Pl remember to press the YES button below.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Patti" wrote:
Last Name First Name ID Date Goal
Doe Jane 123 8/7/08 B
Doe John 124 8/9/08 D

Some rows have the same ID. I would like my results to list unique id's. If
there is the same id in two rows, I would like it to display the row with the
most recent date. If there is the same id in two rows with the same id and
the same date, i would like it to show the row with the highest goal (A being
the highest and so on).