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 23rd, 2002, 10:28 PM   #1
Mood
New Member
 
Join Date: Mar 2002
Location: Manitoba, Canada
Posts: 22
Default

I'm having a problem trying to keep track of a seniority list in XL2K. It calculates correctly, but doesn't display the way I would like it too. I have tried all possible combinations of formatting, with no success. The problems are in columns H and I.

The formula in Cell H4 is as follows:

=DATEDIF(J4,$A$3,"Y")&"." &DATEDIF(J4,$A$3,"YM")

A3 H4 I4 J4
October-01 17.1 17.01 Sep-84

A3 is the date for the calculations formatted as MMM-YY

H4 is the formula and shows a value of 17 Years 1 month, formatted as a number (2 decimal places)

I4 shows the fixed date, which I typed in by hand, and formatted as a number (2 decimal places). Would like to copy and paste from H4.

J4 shows the official start date formatted as MM-YY

Questions:

1) Can H4 show 2 decimal places e.g. xx.01 for one month, xx.02 for two months, xx.10 for ten months?

2) Why does I4 display differently when copied from H4, and pasted special, as values into I4? The difference shows up in the conditional formatting. I have it formatted as green, if it's over 30 years. If I type the value (17.1) in the cell, it stays normal, yet when pasted special, as a value, it show up green. I have tried all possible combinations of formatting, with no success.

3) Is it possible to show the copied value in H4 (17.1) as 17.01 in I4. Again, I have tried all possible combinations of formatting, with no success.

4) If all else fails, would a macro be able to retype the numbers in I4 so they would look right. There are about 300 to 400 rows to be changed. e.g. Changing 17.1 to 17.01 etc...

Thanks for looking into it, and helping...

Sorry for all the questions, but, I have wracked my brain into complete confusion…
Peter
Mood is offline   Reply With Quote
Old Apr 23rd, 2002, 11:23 PM   #2
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-04-23 21:28, Mood wrote:
I'm having a problem trying to keep track of a seniority list in XL2K. It calculates correctly, but doesn't display the way I would like it too. I have tried all possible combinations of formatting, with no success. The problems are in columns H and I.

The formula in Cell H4 is as follows:

=DATEDIF(J4,$A$3,"Y")&"." &DATEDIF(J4,$A$3,"YM")

A3 H4 I4 J4
October-01 17.1 17.01 Sep-84

A3 is the date for the calculations formatted as MMM-YY

H4 is the formula and shows a value of 17 Years 1 month, formatted as a number (2 decimal places)

I4 shows the fixed date, which I typed in by hand, and formatted as a number (2 decimal places). Would like to copy and paste from H4.

J4 shows the official start date formatted as MM-YY

Questions:

1) Can H4 show 2 decimal places e.g. xx.01 for one month, xx.02 for two months, xx.10 for ten months?

2) Why does I4 display differently when copied from H4, and pasted special, as values into I4? The difference shows up in the conditional formatting. I have it formatted as green, if it's over 30 years. If I type the value (17.1) in the cell, it stays normal, yet when pasted special, as a value, it show up green. I have tried all possible combinations of formatting, with no success.

3) Is it possible to show the copied value in H4 (17.1) as 17.01 in I4. Again, I have tried all possible combinations of formatting, with no success.

4) If all else fails, would a macro be able to retype the numbers in I4 so they would look right. There are about 300 to 400 rows to be changed. e.g. Changing 17.1 to 17.01 etc...

Thanks for looking into it, and helping...

Sorry for all the questions, but, I have wracked my brain into complete confusion…
Peter
Hi Peter:
Let us first get to your first question first. Yes! change the formula in H4 to:

=DATEDIF(J4,$A$3,"Y")&IF(DATEDIF(J4,$A$3,"YM")>9,"-","-0")&DATEDIF(J4,$A$3,"YM")

Please note, I recommend changing "." to "-" or some other character of your choice to avoid confusion with a true decimal number --but since I don't know the context in which you are doing this, I will leave it upto you.

It is late and I am going to call it a night now, so your other questions will have to wait. Good Night!

__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Apr 23rd, 2002, 11:49 PM   #3
Qroozn
Board Regular
 
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
Default

2) make sure that when the values are entered they are both entered as text, or number. and reenter the value into the cells.

3)try the following formula which will convert a number to months so 12months =.12, 3 months = .03. I had trouble on 10months. hope it helps

=IF(A1-ROUND(A1,0)=0.109999999999999,0.11,IF(A1-ROUND(A1,0)=0.119999999999999,0.12,IF(A1-ROUND(A1,0)>0,(A1-ROUND(A1,0))*0.1,IF(A1-ROUND(A1,0)<0,(A1-ROUND(A1,0)+1)*0.1))))
Qroozn is offline   Reply With Quote
Old Apr 24th, 2002, 03:09 AM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Peter,

Try:

=DATEDIF(J4,$A$3,"Y")&"." &RIGHT(0&DATEDIF(J4,$A$3,"YM"),2)

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 24th, 2002, 07:40 AM   #5
Mood
New Member
 
Join Date: Mar 2002
Location: Manitoba, Canada
Posts: 22
Default


[/quote]

Please note, I recommend changing "." to "-" or some other character of your choice to avoid confusion with a true decimal number --

[/quote]

Thanks Aladin and Yogi, both ideas worked for the first question.

Yogi's idea of changing the decimal to something else was the thing for all my frustration and the root of my problem.

Any ideas as to the other questions?
Much thanks, Peter
Mood is offline   Reply With Quote
Old Apr 24th, 2002, 08:31 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-24 06:40, Mood wrote:
Please note, I recommend changing "." to "-" or some other character of your choice to avoid confusion with a true decimal number --

[/quote]

Thanks Aladin and Yogi, both ideas worked for the first question.

Yogi's idea of changing the decimal to something else was the thing for all my frustration and the root of my problem.

Any ideas as to the other questions?
Much thanks, Peter
[/quote]

Questions 1 & 3 are the same, no?

The 3rd question is a bit unclear to me. Are you trying to apply cond format to the cells housing the formula results?

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 24th, 2002, 08:54 AM   #7
Mood
New Member
 
Join Date: Mar 2002
Location: Manitoba, Canada
Posts: 22
Default

Quote:
On 2002-04-24 07:31, Aladin Akyurek wrote:
Quote:
On 2002-04-24 06:40, Mood wrote:
Please note, I recommend changing "." to "-" or some other character of your choice to avoid confusion with a true decimal number --
Thanks Aladin and Yogi, both ideas worked for the first question.

Yogi's idea of changing the decimal to something else was the thing for all my frustration and the root of my problem.

Any ideas as to the other questions?
Much thanks, Peter
[/quote]

Questions 1 & 3 are the same, no?

The 3rd question is a bit unclear to me. Are you trying to apply cond format to the cells housing the formula results?

Aladin
[/quote]

Actually, the solving of the first question , also solved the 3rd and 4th question, sorry for not been clearer.

The only remaining question (#2) is why the conditional formating in both H & I columns won't work. I think it might have to do with the values in H are not numbers. Could be wrong...
Peter
Mood 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 07:56 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