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 Feb 18th, 2002, 01:41 PM   #1
J Lowe
New Member
 
Join Date: Feb 2002
Posts: 27
Default

I am needing to turn 0102 into 01/02 . I have thousands of these that I need to convert.

Is there an easy way to do this?

Thank you,
Jason

PS: The new format is great! Maybe one day, I can make more of a contribution to the message board instead of always having to ask for help.
J Lowe is offline   Reply With Quote
Old Feb 18th, 2002, 01:52 PM   #2
Juan Pablo González
MrExcel MVP
 
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
Default

Try with this formula:

=DATE(RIGHT(A1,2)+((RIGHT(A1,2)<"29")*2000),LEFT(A1,2),1)

I'm assuming this is in mmyy format. Also, if any year is below 29, i'm assuming it's 2000, else, 1900.
__________________
Regards,

Juan Pablo González
http://www.juanpg.com
Juan Pablo González is offline   Reply With Quote
Old Feb 18th, 2002, 02:03 PM   #3
J Lowe
New Member
 
Join Date: Feb 2002
Posts: 27
Default

Thank you for your response.

You gave the year 2000 for the date and said that if it was 19** to use that. What if there is a combination of the two? Is there a way to differentiate between them?

Muchismas gracias,
Jason
J Lowe is offline   Reply With Quote
Old Feb 18th, 2002, 02:15 PM   #4
Juan Pablo González
MrExcel MVP
 
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
Default

Do you mean if you have

0110
and
0520

The first one is 01/1910 and the second one is 05/2020 how to differentiate them ? well, manually... You have to set a line somewhere to differentiate between 2000 and 1900.
__________________
Regards,

Juan Pablo González
http://www.juanpg.com
Juan Pablo González is offline   Reply With Quote
Old Feb 18th, 2002, 02:25 PM   #5
J Lowe
New Member
 
Join Date: Feb 2002
Posts: 27
Default

Thanks again for the response.

I am still having problems with the formula.

This is what I am entering:

=DATE(right (G2,2) + ((right(g2,2),"29")*2000), (Left(g2,2),1)

The first cell that I have data in is located in G2.

Any more suggestions?

Thanks again,
J Lowe is offline   Reply With Quote
Old Feb 18th, 2002, 02:41 PM   #6
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

=TEXT(A1,"00/00")+0
Mark W. is offline   Reply With Quote
Old Feb 18th, 2002, 03:08 PM   #7
J Lowe
New Member
 
Join Date: Feb 2002
Posts: 27
Default

Ok guys....I'm really starting to feel dumb here. For some reason, my results are not turning out the way I need them to.

This is a part of the data set that I am working with:

Matter Period
1191
1091
1091
0150

This is Juan's formula as I have entered it:

=DATE(RIGHT(G2,2)+((RIGHT(G2,2)<"29")*2000),LEFT(G2,2),1)

These are the results I am getting for the same set:

1/0/1900

I am needing:

Matter Period
11/91
10/91
10/91
01/50

Or:

Matter Period
11/1991
10/1991
10/1991
01/1950

The reason I am needing it in this format is that I am working with Pivot Tables and the sort is not working properly, due to the format of the dates. My goal is to have these numbers in a format where I can sort my data by the date of the matter.

This is how my Pivot Table is set up:

Matter
Date Owner Aty Total

0100 COAT BARRY $5,890.00
JAMES $13,919.50
0101 COAT JAMES $37,093.12
0102 COAT BARRY $6,613.50
JAMES $71,849.50

As you can see, it is sorting my data by the first numbers, or the month, and not the year. I have to have it sorted by year and month.

Any more recommendations?

I appreciate your help.

Jason


J Lowe is offline   Reply With Quote
Old Feb 18th, 2002, 03:22 PM   #8
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Quote:
On 2002-02-18 14:08, J Lowe wrote:
Ok guys....I'm really starting to feel dumb here. For some reason, my results are not turning out the way I need them to.

This is a part of the data set that I am working with:

Matter Period
1191
1091
1091
0150

This is Juan's formula as I have entered it:

=DATE(RIGHT(G2,2)+((RIGHT(G2,2)<"29")*2000),LEFT(G2,2),1)

These are the results I am getting for the same set:

1/0/1900

I am needing:

Matter Period
11/91
10/91
10/91
01/50

Or:

Matter Period
11/1991
10/1991
10/1991
01/1950

The reason I am needing it in this format is that I am working with Pivot Tables and the sort is not working properly, due to the format of the dates. My goal is to have these numbers in a format where I can sort my data by the date of the matter.

This is how my Pivot Table is set up:

Matter
Date Owner Aty Total

0100 COAT BARRY $5,890.00
JAMES $13,919.50
0101 COAT JAMES $37,093.12
0102 COAT BARRY $6,613.50
JAMES $71,849.50

As you can see, it is sorting my data by the first numbers, or the month, and not the year. I have to have it sorted by year and month.

Any more recommendations?

I appreciate your help.

Jason
First, let me say that my earlier response was predicated on the belief that your dates were in MMDD format. Sorry for my misunderstanding. Now on to Juan's formula. Really, all you need is...

=DATE(RIGHT(G2,2),LEFT(G2,2),1)

Excel will automatically interpet the year
based on the following...


00-29 will be mapped to 2000
30-99 will be mapped to 1900

This is explained in the Help Topic for
"year 2000".


[ This Message was edited by: Mark W. on 2002-02-18 14:29 ]
Mark W. is offline   Reply With Quote
Old Feb 18th, 2002, 04:15 PM   #9
J Lowe
New Member
 
Join Date: Feb 2002
Posts: 27
Default

That is so much closer. I found that I was trying to plug the formula into the formula bar, instead of just pasting on top of the number that I already have.

Now, there is just one more problem. The format of these dates, with the formula you have given, is in mm/dd/yy, but I need it in mm/yy. Can this be done??

Thank you all again.
Jason
J Lowe is offline   Reply With Quote
Old Feb 18th, 2002, 04:17 PM   #10
Barrie Davidson
MrExcel MVP
 
Barrie Davidson's Avatar
 
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
Default

Quote:
On 2002-02-18 15:15, J Lowe wrote:
That is so much closer. I found that I was trying to plug the formula into the formula bar, instead of just pasting on top of the number that I already have.

Now, there is just one more problem. The format of these dates, with the formula you have given, is in mm/dd/yy, but I need it in mm/yy. Can this be done??

Thank you all again.
Jason
Custom format your cells as mm/yy. From the main menu, Format|Cells. On the number tab, select custom and then type in mm/yy in the type box.
__________________
Barrie Davidson

"You're only given a little spark of madness. You mustn't lose it." - Robin Williams
Barrie Davidson 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:23 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