MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 16th, 2002, 09:22 PM   #1
thompsob18
New Member
 
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
Default

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.
thompsob18 is offline   Reply With Quote
Old May 16th, 2002, 11:17 PM   #2
Rocky E
Board Regular
 
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
Default

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...
Rocky E is offline   Reply With Quote
Old May 16th, 2002, 11:25 PM   #3
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

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 ]
Yogi Anand is offline   Reply With Quote
Old May 17th, 2002, 12:33 AM   #4
thompsob18
New Member
 
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
Default

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.
thompsob18 is offline   Reply With Quote
Old May 17th, 2002, 12:41 AM   #5
thompsob18
New Member
 
Join Date: May 2002
Location: Melbourne, Australia
Posts: 6
Default

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.
thompsob18 is offline   Reply With Quote
Old May 17th, 2002, 10:41 AM   #6
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

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 :

Microsoft Excel - thompsob18.xls_______________Running: xl97 : OS = Windows (32-bit) 4.90
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
D47=
*ABCDEFGH
1NameCourse CodeDate*Max of DateCode**
2John1:alert('36892')>01/01/2001*Name123
3John2:alert('=+C2+1')>02/01/2001*George:alert('36897')>06-Jan-01:alert('36898')>07-Jan-01:alert('36896')>05-Jan-01
4John3:alert('=+C3+1')>03/01/2001*John:alert('36898')>07-Jan-01:alert('36899')>08-Jan-01:alert('36900')>09-Jan-01
5John1:alert('=+C4+1')>04/01/2001*Paul:alert('36904')>13-Jan-01:alert('36902')>11-Jan-01:alert('36903')>12-Jan-01
6John2:alert('=+C5+1')>05/01/2001*Ringo:alert('36902')>11-Jan-01:alert('36900')>09-Jan-01:alert('36901')>10-Jan-01
7John3:alert('=+C6+1')>06/01/2001*****
8John1:alert('=+C7+1')>07/01/2001*****
9John2:alert('=+C8+1')>08/01/2001*****
10John3:alert('=+C9+1')>09/01/2001*****
11Paul1:alert('36892')>01/01/2001*****
12Paul2:alert('=+C11+1')>02/01/2001*****
13Paul3:alert('=+C12+1')>03/01/2001*****
14Paul1:alert('=+C13+1')>04/01/2001*****
15Paul2:alert('=+C14+1')>05/01/2001*****
16Paul3:alert('=+C15+1')>06/01/2001*****
17Paul1:alert('=+C16+1')>07/01/2001*****
18Paul2:alert('=+C17+1')>08/01/2001*****
19Paul3:alert('=+C18+1')>09/01/2001*****
20Paul1:alert('=+C19+1')>10/01/2001*****
21Paul2:alert('=+C20+1')>11/01/2001*****
22Paul3:alert('=+C21+1')>12/01/2001*****
23Paul1:alert('=+C22+1')>13/01/2001*****
24George2:alert('36892')>01/01/2001*****
25George3:alert('=+C24+1')>02/01/2001*****
26George1:alert('=+C25+1')>03/01/2001*****
27George2:alert('=+C26+1')>04/01/2001*****
28George3:alert('=+C27+1')>05/01/2001*****
29George1:alert('=+C28+1')>06/01/2001*****
30George2:alert('=+C29+1')>07/01/2001*****
31Ringo3:alert('36892')>01/01/2001*****
32Ringo1:alert('=+C31+1')>02/01/2001*****
33Ringo2:alert('=+C32+1')>03/01/2001*****
34Ringo3:alert('=+C33+1')>04/01/2001*****
35Ringo1:alert('=+C34+1')>05/01/2001*****
36Ringo2:alert('=+C35+1')>06/01/2001*****
37Ringo3:alert('=+C36+1')>07/01/2001*****
38Ringo1:alert('=+C37+1')>08/01/2001*****
39Ringo2:alert('=+C38+1')>09/01/2001*****
40Ringo3:alert('=+C39+1')>10/01/2001*****
41Ringo1:alert('=+C40+1')>11/01/2001*****
Sheet1

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 ::
Chris Davison is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:30 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes