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

The key source cols ID & Date are presumed/required to be filled for each row
of data. Col E (Goal) must be also be fully pre-populated, otherwise col M
will display #VALUE!. Just pre-fill all new rows in advance in col E with
say, the letter Z. That's the reason behind the earlier caveat line:
(E2:E100 is assumed fully populated with letter grades)


Here's a working sample for easy reference:
http://freefilehosting.net/download/448j2
Multiple complex criteria extracts.xls

Some explanations on What's happening?
1. Cols F & G (together) derives the uniques list of IDs and packs it all up
at the top
2. Col H then gathers the most recent date for the IDs. Since real dates are
numbers, the most recent date = maximum number for the ID

Reading the uniques list of IDs and most recent dates in cols G and H,
3. Cols I to L completes the extract from all source cols, except for col E
(Goal) which needs special treatment (in col M)

4. Col M extracts the "highest" Goal results. CODE is used to convert the
letter grades (A, B, C, etc) to numbers within the conditional MIN (A=65,
B=66, and so on), while the outer CHAR re-converts it back to the letter
grades after MIN evaluates the required lowest numeric equivalent for the ID
and its most recent date (the lowest num = "highest" goal). The source col E
must be fully populated, otherwise col M will display #VALUE!. Just pre-fill
all new rows in advance in col E with say, the letter Z.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Patti" wrote:
Thank you for your reply. I tried it and it populated information in rows I
and L. Rows J and K are blank and row M shows VALUE!. In my example, I left
out that the duplicate person does not list the id. EX:

Last Name First Name ID Date Goal
Doe Jane 123 8/7/08 B
Doe John 124 8/9/08 D
Doe John 8/9/08 B

So the blank row is populating the information for the next row.