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 26th, 2002, 12:34 PM   #1
Dukester
New Member
 
Join Date: May 2002
Posts: 8
Default

Is there a way to make a cell turn a number, say "12", into the day of a specified month, then format according to the date style you want, say "3/12/02"?
Dukester is offline   Reply With Quote
Old May 26th, 2002, 12:46 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-26 11:34, Dukester wrote:
Is there a way to make a cell turn a number, say "12", into the day of a specified month, then format according to the date style you want, say "3/12/02"?
Not sure whether you mean what follows:

If A1 houses 12, A2 4, and A3 2002, then

=DATE(A3,A2,A1) would give you a date you can format as mm/dd/yy.

Is this what you're asking for?
Aladin Akyurek is offline   Reply With Quote
Old May 26th, 2002, 01:00 PM   #3
Dukester
New Member
 
Join Date: May 2002
Posts: 8
Default

Not exactly. I have rows for each month of the year. I have to be able to only type in the day, and then have that cell recognize which month it is in and produce "4/12" or whatever. A related problem I have is that it defaults to 1900.
Dukester is offline   Reply With Quote
Old May 26th, 2002, 01:11 PM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-26 12:00, Dukester wrote:
Not exactly. I have rows for each month of the year. I have to be able to only type in the day, and then have that cell recognize which month it is in and produce "4/12" or whatever. A related problem I have is that it defaults to 1900.
Give an example with the cell references involved.
Aladin Akyurek is offline   Reply With Quote
Old May 26th, 2002, 01:50 PM   #5
Dukester
New Member
 
Join Date: May 2002
Posts: 8
Default

Let's say row 5 is for January with D5:R5 alloted for dates to be determined. They refer to no other cells. I need to be able type in any day and have it automatically become, "1/12", etc. The problem is solved if I just type in 1/12, but that is not acceptable for this spreadsheet. Am I truely limited to the formatting options in the pull-down menu, or is there a way to customize them?
Dukester is offline   Reply With Quote
Old May 26th, 2002, 02:00 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-26 12:50, Dukester wrote:
Let's say row 5 is for January with D5:R5 alloted for dates to be determined. They refer to no other cells. I need to be able type in any day and have it automatically become, "1/12", etc. The problem is solved if I just type in 1/12, but that is not acceptable for this spreadsheet. Am I truely limited to the formatting options in the pull-down menu, or is there a way to customize them?
You can't just type 12 in D5 which then magically becomes 1/12. Formatting will not help either, also because the value in D5 will stay the value that you entered.

Maybe VBA programmers would offer code that meets your demand.

Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 26th, 2002, 02:11 PM   #7
Dukester
New Member
 
Join Date: May 2002
Posts: 8
Default

I appreciate your help.
Dukester is offline   Reply With Quote
Old May 26th, 2002, 02:21 PM   #8
DeLaMartre
New Member
 
Join Date: May 2002
Location: Southern California
Posts: 31
Default

Dukester,
You could make your own "Custom" number format by going to Format/Cells/Custom and typing in "1/"## for the new format. Then, whenever you type in a "4" for instance, you would get "1/4".

You would have to format each column, of course, according to the number of the month.

This is not an "all-encompassing" solution, but it is relatively simple (no VBA).

I hope this helps some.

-Bob in California
DeLaMartre is offline   Reply With Quote
Old May 26th, 2002, 02:27 PM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-26 13:21, DeLaMartre wrote:
Dukester,
You could make your own "Custom" number format by going to Format/Cells/Custom and typing in "1/"## for the new format. Then, whenever you type in a "4" for instance, you would get "1/4".

You would have to format each column, of course, according to the number of the month.

This is not an "all-encompassing" solution, but it is relatively simple (no VBA).

I hope this helps some.

-Bob in California
Bob,

You can't compute from the cell so formatted that it's 4/12. It will be just 12.

Aladin

Aladin Akyurek is offline   Reply With Quote
Old May 26th, 2002, 02:29 PM   #10
dimrod
 
Join Date: May 2002
Posts: 73
Default

The following code is based on having the year in A1 and numbers 1 to 12 in A5:A16 to represent the months.
This is just for illustration - the code would need revision based on your sheet's actual layout.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [D5:R16]) Is Nothing Then
Application.EnableEvents = False
Target.Value = DateSerial([A1], Cells(Target.Row, 1), Target)
Application.EnableEvents = True
End If
End Sub

Edit : Forgot to mention - if you want to use this method, the code will need some error handlers.


[ This Message was edited by: dimrod on 2002-05-26 13:46 ]
dimrod 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 11: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