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 Mar 28th, 2002, 05:52 PM   #1
jonasmckee
New Member
 
Join Date: Mar 2002
Posts: 1
Default

I am need of a way for the cells in row 1 to fill in the dates automatically backwards for 13 months. For example..
At cell N1 the user would put in a Date (3/15/02), then cells M1 backwards to A1 would then fill in the dates (M1 would equal N1 minus one month, L1 would equal N1 minus one month, etc.)
Any help would be aprrectiated please..

jonasmckee is offline   Reply With Quote
Old Mar 28th, 2002, 08:37 PM   #2
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default

in N1 3/15/02 or 15/03/02 depending on how your system is set up (edited)

in M1 =DATE(YEAR(N1),MONTH(N1)-1,DAY(N1))
copy M1 to L to A

Set references to absolute if all months
are to be - 1.

Format the cells so the information fits.

[ This Message was edited by: Dave Patton on 2002-03-28 19:59 ]

[ This Message was edited by: Dave Patton on 2002-03-28 20:01 ]
Dave Patton is offline   Reply With Quote
Old Mar 28th, 2002, 08:48 PM   #3
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

Hi

You can also use the EDATE Function for this. Let's say the date is in cell A1

=EDATE(A1,-1)

Just copy this across. The EDATE is part of an Excel Add-in so before trying, go to Tools>Add-ins and check the "Analysis toolpak"


Dave Hawley is offline   Reply With Quote
Old Mar 28th, 2002, 08:53 PM   #4
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-03-28 19:37, Dave Patton wrote:

in N1 15/03/02
in M1 =DATE(YEAR(N1),MONTH(N1)-1,DAY(N1))
copy M1 to L to A

Set references to absolute if all months
are to be - 1.

Format the cells so the information fits.
Hi Dave Patton:
In N1 ... 3/15/02 and not 15/3/02

Funny thing is Excel will accept an entry like 15/3/02 as a text entry and fool one into thinking every thing is OK!

[ This Message was edited by: Yogi Anand on 2002-03-28 19:54 ]

[ This Message was edited by: Yogi Anand on 2002-03-28 19:55 ]
Yogi Anand is offline   Reply With Quote
Old Mar 28th, 2002, 08:58 PM   #5
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


Quote
" Funny thing is Excel will accept an entry like 15/3/02 as a text entry and fool one into thinking every thinking is OK!"

Sorry about that, my system is set ddmmyyyy and my editor is nearly asleep. I should not do my own editing.

The type does not change the suggestion.

You have a major challenge if your are about to edit the spelling and English in these newsgroups!
Dave Patton is offline   Reply With Quote
Old Mar 28th, 2002, 08:58 PM   #6
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Hi Dave Hawley:
That's Great ... Short and Sweet!
Yogi Anand is offline   Reply With Quote
Old Mar 28th, 2002, 10:13 PM   #7
gypo
 
Join Date: Feb 2002
Posts: 7
Default

Quote:
On 2002-03-28 19:48, Dave Hawley wrote:
Hi

You can also use the EDATE Function for this. Let's say the date is in cell A1

=EDATE(A1,-1)

Just copy this across. The EDATE is part of an Excel Add-in so before trying, go to Tools>Add-ins and check the "Analysis toolpak"

But, small note :-

If the date entered in the start cell is the last day of a month and the last day of each month is required in the other cells, EDATE on its own will not produce the required results ..... but then neither will the formula =DATE(YEAR(N1),MONTH(N1)-1,DAY(N1))




[ This Message was edited by: gypo on 2002-03-28 21:19 ]
gypo is offline   Reply With Quote
Old Mar 28th, 2002, 11:50 PM   #8
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

Hi

RE:If the date entered in the start cell is the last day of a month and the last day of each month is required in the other cells, EDATE on its own will not produce the required results

Maybe you should try it and you will see it does.
Dave Hawley is offline   Reply With Quote
Old Mar 29th, 2002, 12:45 AM   #9
gypo
 
Join Date: Feb 2002
Posts: 7
Default

Quote:
On 2002-03-28 22:50, Dave Hawley wrote:
Hi

RE:If the date entered in the start cell is the last day of a month and the last day of each month is required in the other cells, EDATE on its own will not produce the required results

Maybe you should try it and you will see it does.

I would suggest that you're the one who hasn't tried it.

Put 30 November 2002 in cell A1.
Put =EDATE(A1,-1) in A2 and drag down.

A3 will show 30 Oct (normally the 31st is the last day of October, isn't it?), and the day in each cell below will be 30 until Feb when it will be 28. Thereafter, the day in each cell will be 28.

gypo is offline   Reply With Quote
Old Mar 29th, 2002, 12:51 AM   #10
Bob Umlas
Board Regular
 
Join Date: Mar 2002
Location: New York
Posts: 71
Default

MUCH easier way:
In N1 enter your date. Then right-click the fill handle and drag left to cell B1, for example. When you let go, you'll see a dropdown which enables you to choose "Fill Months". They will be backwards, as you wanted.
Bob Umlas 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 04:50 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