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 15th, 2002, 06:44 PM   #1
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

How to Create:
Need to have 6-mos forward date generated if certain criteria are met.
Need to have 12-mos forward date generated if criteria are not met.

APPLICATION:
---New Employee #1 starts on 02/03/02, is assigned to Radiology (high risk), and requires medical screening every six months (08/02/02, 02/02/03, etc.).
---New Employee #2 starts same day, assigned to Neurology (low risk), requires medical screening once per year (02/02/03, 02/02/04 etc.).

MODEL for Columns A, B, C, D:
Start ed-------Assigned to-------6-mos Med-------12-mos Med

The “high risk” Assigned to areas would be the criteria to be met to generate a 6-mos date. These are in Column B (“DEM”, “RAD”, “IMM”, “RT”, “PUL”, or “UCC”). Anything else in Col. B would = 12-mos forward date.

WHAT ABOUT
--When Start Date is for Old Employee: e.g., Started 02/03/99
KATHWUN is offline   Reply With Quote
Old May 15th, 2002, 07:01 PM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Assuming that your data starts on the 2nd row... in C2 enter the formula...

=IF(OR($B2={"DEM","RAD","IMM","RT","PUL","UCC"}),EDATE(TEXT($A2,"m-d"),6),"")

...and fill down as needed. In D2 enter the formula...

=EDATE(TEXT($A2,"m-d"),12)

...and fill down as needed.

Note: The EDATE worksheet function is available after the installation of the Analysis ToolPak add-in.


[ This Message was edited by: Mark W. on 2002-05-15 18:11 ]
Mark W. is offline   Reply With Quote
Old May 15th, 2002, 07:01 PM   #3
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

Does it matter whether the forward dates fall on 'workdays'? If not,
Assuming the data starts in row7:

=IF(OR(B7="DEM", B7="RAD",B7="IMM", B7="RT", B7="PUL", B7="UCC"),A7+180,A7+365)

If it does matter what day the forward date falls on, it will be a little harder.

Paddy


Or, having seen Mark's post, it wont be!

[ This Message was edited by: PaddyD on 2002-05-15 18:03 ]
PaddyD is offline   Reply With Quote
Old May 15th, 2002, 07:03 PM   #4
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-15 17:44, KATHWUN wrote:
How to Create:
Need to have 6-mos forward date generated if certain criteria are met.
Need to have 12-mos forward date generated if criteria are not met.

APPLICATION:
---New Employee #1 starts on 02/03/02, is assigned to Radiology (high risk), and requires medical screening every six months (08/02/02, 02/02/03, etc.).
---New Employee #2 starts same day, assigned to Neurology (low risk), requires medical screening once per year (02/02/03, 02/02/04 etc.).

MODEL for Columns A, B, C, D:
Start ed-------Assigned to-------6-mos Med-------12-mos Med

The “high risk” Assigned to areas would be the criteria to be met to generate a 6-mos date. These are in Column B (“DEM”, “RAD”, “IMM”, “RT”, “PUL”, or “UCC”). Anything else in Col. B would = 12-mos forward date.
If your StartDate ... entries begin in row 2, use the following formulas

in cell C2 ... =IF($B2={"DEM","RAD","IMM","RT","PUL","UCC"},EDATE($A2,6),""))

in cell D2 ... =IF($B2={"DEM","RAD","IMM","RT","PUL","UCC"},"",EDATE($A2,12))

Please post back if it works for you ... otherwise explain a little further and let us take it from there.

Regards!




__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old May 15th, 2002, 07:35 PM   #5
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi KATHWUN:

WHAT ABOUT
--When Start Date is for Old Employee: e.g., Started 02/03/99


for such a situation I came up with the following formulas -- so with StartDate of 02/03/99
Code:
=DATE(YEAR(NOW()),IF(MONTH($A6)
Please post back if it works for you ... otherwise explain a little further and let us take it from there.

Regards!







[ This Message was edited by: Yogi Anand on 2002-05-15 18:38 ]
Yogi Anand is offline   Reply With Quote
Old May 15th, 2002, 08:29 PM   #6
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

TO: MarkW, PaddyD and YogiA
Mark, the Analysis ToolPak add-in must be missing, because your and Yogi's formulae do not work. Paddy, Yours DID work within the parameters I gave you.
And no, it doesn’t matter if the date is not a business-day date. We’ll compensate for that.

I STILL HAVE A PROBLEM:
EXAMPLE #1, say that I have an employee that started 02/03/98,and has had all med-screenings annually (99,00,01,02). Bouncing off of Start Date doesn't work here. It shows 3/3/99, but I need it to “think” 2/3/03.
EXAMPLE #2: a 7/9/01 start date requires 6-mos (180 days) med screening. Paddy’s formula generates 1/7/02. That suggests that he MISSED a screening. His ACTUAL next is scheduled for 7/9/02

QUESTION: Is there a way to make and ADD an assumption to the formula that says, in effect, “If the 6-mos (or 12-mos) incremental date generated is EARLIER than TODAY-date, calculate (count) the past increments from Start Date forward to next forward increment past TODAY date.
Here’s hoping. . . .


[ This Message was edited by: KATHWUN on 2002-05-15 19:32 ]
KATHWUN is offline   Reply With Quote
Old May 15th, 2002, 08:42 PM   #7
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

Haven't really thought this through, but what you need is some way to increment the number of times you calculate the 6 and 12 month periods depending on how many of them have passed since the start date. Something like:

=IF(OR(B7="DEM", B7="RAD",B7="IMM", B7="RT", B7="PUL", B7="UCC"),A7+(180*(YEAR(TODAY())-YEAR(A7))),A7+(365*(YEAR(TODAY())-YEAR(A7))))

might do it, but you'll need to check,

Paddy


Actually - this will only work for the yearly checks. You could just multiply the 180 day checks by 2, but you'd miss all the odd-numbered 6 monht periods.

If we add the logic to calculate the number of 6 month periods that have elapsed, the formula's going to get really messy (unless you do a 'six_months_elapsed' UDF). Might be better to calculate number of relevant periods that have elapsed, stick the results into new cells & use them to drive the calculations. (it might be usful to know how many checks each employee has had anyway)

paddy

[ This Message was edited by: PaddyD on 2002-05-15 19:59 ]
PaddyD is offline   Reply With Quote
Old May 15th, 2002, 09:10 PM   #8
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi KATHWUN:
To get the Analysis ToolPak working, all you have to do is

TOOLS|ADD-INs and then select Analysis_TolPak
in the dialog bos, the OK -- and you will have the functionality of Analysis ToolPak made available.

Regards!
Yogi Anand is offline   Reply With Quote
Old May 15th, 2002, 09:23 PM   #9
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

Paddy, I agree with counting the increments past. FEEDBACK: Using your latest formula, I put in hypothetical date of 2/3/99 and got date 7/27/00 -- or 9-mos. Oops.

QUESTION: Is excel reading (YEAR(TODAY())from the clock or do I need to reference a cell location to make this count increments?
______________________________________
=IF(OR(B7="DEM", B7="RAD",B7="IMM", B7="RT", B7="PUL", B7="UCC"), A7+(180*(YEAR(TODAY())-YEAR(A7))),A7+(365*(YEAR(TODAY())-YEAR(A7))))

I'll check in tomorrow a.m.
Thanks, Paddy.
Kath




KATHWUN is offline   Reply With Quote
Old May 15th, 2002, 10:24 PM   #10
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

Kath,

If you don't mind adding extra fields to your table, I'd go with:

StartDate : Category ('DEM' etc): Period Type (6 or 12 month): Periods Since Start : Next Review

With the following codes:

Period Type:
=IF(OR(B2="DEM", B2="RAD",B2="IMM", B2="RT", B2="PUL", B2="UCC"),6,12)

Periods Since Start:
=IF(C2=12,YEAR(TODAY())-YEAR(A2),IF(C2=6,ROUND((TODAY()-A2)/180,0),""))

Next Review:
=IF(C2=6,A2+(180*D2),IF(AND(C2=12,D2<>0),(A2+(365*(D2+1))),(A2+365)))


The only anomaly I can find is that those on a six month review frequency with a start date after today get a review on their start date.

Will this do?

Paddy


P.S. Today() runs off the clock


[ This Message was edited by: PaddyD on 2002-05-15 21:47 ]
PaddyD 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:28 PM.


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