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 2nd, 2002, 09:26 AM   #1
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

hello all,

Just seeing if there can be a better way to do this. I have a cell (I4) that contains a month ending date. Then I have a cell that is hidden that contains the previous months ending date(d61). When we are ready for the new month we click a command button and it transfers the date in cell (I4) down to cell (D61) so then it becomes the previous months date. Then we enter the new month ending date in cell (I4). I do it this way because I need to compare the two dates to see if there are 4 or 5 weeks between them for our scheduling purposes. This works fine for me because I know how to use the worksheet. But the file was sent to someone else and they couldn't figure out how to work it so it filled in the dates automattically like I have it set up to based on the two in cells (I4) and (D61). Can anyone think of a different (easier) way to compare two dates? I can't, you have to have a start and end date right? My boss is telling me the way I have it now is to complicated for the people who will be using it. There is one thing wrong with it now. It will only work based on either 4 or 5 weeks.

Just looking for ideas.
__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Apr 2nd, 2002, 09:34 AM   #2
wi_guy
Board Regular
 
Join Date: Mar 2002
Posts: 50
Default

What about a lookup table, with the period end dates in 1 column, and the # of weeks in another.....then you can always reference the current date and it will lookup the correct # of weeks for you
wi_guy is offline   Reply With Quote
Old Apr 2nd, 2002, 09:39 AM   #3
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

Not sure exactly what your after, but if you have your current month end date in A1, you could use
=DATE(YEAR(A1),MONTH(A1),0)
to find the last month end date. taking it a step further,
=(A1-DATE(YEAR(A1),MONTH(A1),0))/7
would give you the number of weeks. Of course, all months except most February's will be 4.something, not a clean 4 or 5 like you say. Oh well, food for thought.
IML is offline   Reply With Quote
Old Apr 2nd, 2002, 09:40 AM   #4
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

haven't used one befor but good idea. I'll see if I can work it out.
Thanks,
__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Apr 2nd, 2002, 09:40 AM   #5
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


Consider the following

With a date in A2
end of month =DATE(YEAR(A2),MONTH(A2)+1,0)
end of previous =DATE(YEAR(A2),MONTH(A2),0)

Named range of months 1-12 and # of weeks
(based on your preferences)
Name the range rWeeks

Number of Weeks =LOOKUP(MONTH(A2),rWeeks)
Dave Patton is offline   Reply With Quote
Old Apr 2nd, 2002, 09:40 AM   #6
Ricky Morris
Board Regular
 
Join Date: Mar 2002
Posts: 363
Default

I would use a combo box with periods 1 - 12 that the user can choose. The result from the list box could be used to obtain current and previous period end dates via a lookup table.

Let me know if this helps or if you need more specifics.
__________________
It's never too late to learn something new.

Ricky
Ricky Morris 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 06:57 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