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

SAMPLE of Dates in database
A--------------------B--------------------C---------------------D
__________________________________________
---START-------END--------RESTART------------STATUS
1 02/02/02-------------------------------------------------Active
2 06/07/01----10/10/01---------------------------------Inactive
3 04/05/00----03/03/01----02/02/02----------------Active
__________________________________________

Need formula in STATUS column
(1)to interpret dates in relative row and
(2)to insert either "Active" or "Inactive" in STATUS cell.
Active = If START date is input
Inactive = if start date + END date are input
Active = if start date, end date, and RESTART date are input.

CONDITIONS:
All valid dates = earlier than the NOW date -- at least by =NOW() -1 day.
All valid dates = later than those in the preceding column.

Please notify if more info or an attachment is needed showing model.


[ This Message was edited by: KATHWUN on 2002-04-08 21:11 ]
KATHWUN is offline   Reply With Quote
Old Apr 8th, 2002, 10:04 PM   #2
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


Edit or refine the following

=IF(OR(AND(A2>0,A2<$G$1,B2=""),AND(C2>0,B2<$G$1,C2<$G$1)),"Active","Inactive")

G1 has the following =today()



[ This Message was edited by: Dave Patton on 2002-04-08 21:05 ]
Dave Patton is offline   Reply With Quote
Old Apr 8th, 2002, 10:34 PM   #3
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Assuming that A1:D4 houses the sample along with expected results:

In D1 enter and copy down:

=(COUNT(A2:C2)=3)*(C2
Select D2:D4 and custom format the selection as:

=0]"Inactive";[=1]"Active";General

Or, alternatively,

in D1 enter and copy down:

=IF((COUNT(A2:C2)=3)*(C2
Aladin

Aladin Akyurek is offline   Reply With Quote
Old Apr 8th, 2002, 10:40 PM   #4
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

Thank YOU, Dave Patton!
With slight variation (reversing Active/Inactive), your formula worked perfectly. I love this site!
KATHWUN is offline   Reply With Quote
Old Apr 8th, 2002, 10:43 PM   #5
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

Thank you,too, Aladin.
I'll try your formula as well.
To think I almost lost hope -- and VOILA!
Genius at my fingertips.
KATHWUN is offline   Reply With Quote
Old Apr 8th, 2002, 10:53 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-08 21:43, KATHWUN wrote:
Thank you,too, Aladin.
I'll try your formula as well.
To think I almost lost hope -- and VOILA!
Genius at my fingertips.
If you try, replace TODAY() by a cell ref as Dave (Dave Patton, that is) does.
Aladin Akyurek is offline   Reply With Quote
Old Apr 8th, 2002, 10:58 PM   #7
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


Please clarify what you mean by reversing.

The formula give the Active or inactive per your example.
Dave Patton is offline   Reply With Quote
Old Apr 9th, 2002, 08:46 PM   #8
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

REPLY and QUESTION to Dave Patton:
I began at Row 4, put Today() at A1, above the title row, and this is the formula used:
=IF(OR(AND(A4>0,A4<$A$1,B4=""), AND(C4>0,B4<$A$1,C4<$A$1)),"Active","Inactive")

My earlier statement of transposing Active and Inactive was an error (mea culpa), Dave, which I noticed and corrected AFTER I sent the delighted reply. I didn't think you would react, so I didn't want to busy the board with the news of my discovery post-reply. The above, as you advised, worked perfectly.

QUESTION:
How do I construct a formula for inputting current-year dates, so that data entry only requires month/day (e.g., 1/31 or 3/5 or 4/15) and formula inserts /year (e.g., /02, and next year -- /03)?
Thanks in advance.
Kath

[ This Message was edited by: KATHWUN on 2002-04-09 19:56 ]
KATHWUN is offline   Reply With Quote
Old Apr 9th, 2002, 09:03 PM   #9
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi KATHWUN:
Entering the date as 1/31, 3/5, or 4/15 in a cell will automatically take the date as for the current year.
so if you enter in a cell 1/31, and format the cell to show the date as 03/14/98, it will show up as
01/31/2002

HTH
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Apr 9th, 2002, 09:55 PM   #10
KATHWUN
Board Regular
 
Join Date: Apr 2002
Location: California
Posts: 61
Default

You're sooo right. It worked!
Thank you, Yogi.
Love the site!
KATHWUN 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 09:18 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