![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
|
Howdy,
I've been asked to provide a solution for a rather difficult Excel problem. A client has a worksheet with about 14000 rows, containing course information for their staff. The three items we're looking at here are the staff member's name, course code, and completion date. For example (in CSV): Name,Code,Date "John Doe",ODHS75A,29/04/2002 For the purpose of this exercise, assume: 1:1 - Headings A2:A14000 - Names B2:B14000 - Codes C2:C14000 - Dates What we want to do is set up another sheet, with staff names in column A, and course codes in row 1, with matching completion dates making up the bulk of the table. I could normally match against each name & code, with an INDEX/MATCH array formula. However the problem is that some courses are taken regularly by staff, hence there is more than one date match for a given name and course code. In that case, the most recent completion date needs to be returned. I really need to implement this with formulas (no VB, as the client has to maintain the sheet themselves). It doesn't have to be a single cell formula, I'm happy to use multiple columns per course code, or multiple rows per staff member, and hide any "working" cells if necessary. Any and all assistance is much appreciated. Thanks -Ben. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
|
Hi Ben,
You did a WONDERFUL job of defining your input, but you don't provide enough on the output you are looking for. Give us the same detail for the output, please... Rocky... |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi thompsob18:
This is how I approached it -- step by step ... 1. I first inserted a column C to concatenate Name & Course entries -- naming this field NameCode. I converted the formulas in NameCode field to values. 2. Then I sorted the list by Date--descending, and then NameCode-- ascending. 3. Then I inserted a column either side of NameCode field. Then I used Advanced Filter on just the NameCode field to extract Unique records only. 4. Then I copied the unique records to a new worksheet, say cells A1:A14000 5. Then I used the VLOOKUP function to lookup the date to correspond each entry in column A of this sheet using the original list in sheet1. I could also have used the Index and Match functions to accomplish this. 6. Then it was just a matter of parsing the NameCode field back into Name and Code fields. Hope This Helps Regards! _________________ Yogi Anand Edit: Deleted inactive web site reference from hard code signature line [ This Message was edited by: Yogi Anand on 2003-01-19 16:56 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
|
OK, here's what I require in for output, in more detail:
1:1 - Course Codes A:A - Saff Names B2:IV65536 - Most Recent Date matching course code & name For example, if: A4 = "John Doe" D1 = ODHS75A Then formula in cell D4 would match the course completion date for "John Doe" & "ODHS75A" in the source table (Columns A & B in my original post), and if there are multiple matches, return the most recent completion date (Column C). Hope this makes things a bit clearer. One thing I've thought about: Finding the "most recent date" could be done with a simple IF X>Y type comparison of the datevalues... Food for thought, anyway. |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
|
Hi Yogi, thanks for your suggestion.
Unfortunately, while I would be happy to manipulate the data in the way that you've suggested, my client is not very Excel literate, and would have difficulty in regularly performing the steps you describe. What I'm trying to develop here is a foolproof, black-box worksheet ie: If I were to lock the cells containing the search formulas, the client would be able to enter their own names and course codes in column A and Row 1, and the matches would "magically appear" without any extra steps. |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Hi Ben,
would allow a single click as acceptable ? If so, maybe a pivot table would help out. Give your data a dynamic named ranged so you don't have to worry about it expanding or shrinking over time, then set up the pivot table as follows : Row field = name Column field = course code Data = date double click on Data and assign it "max" rather than "count" or "sum" then format this field as date and whatever is appropriate (say, dd-mm-yyyy) and it should do exactly what you need, just needing a right click to refresh on addition of new records : To see the formula in the cells just click on the cells hyperlink The above image was automatically generated by [HtmlMaker V1.20] If you want this code, click here and Colo will email the file to you. This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo
__________________
:: Pharma Z - Family drugstore :: |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|