I get date information in the format mmyy (eg. 0311 is March, 2011). Is there any way to either make the information yymm or change it into some other Excel recognizable format that can be displayed (eg. Mar-2011, etc.)?
I'm trying to conditionally format the cells so that certain dates receive different background colors, depending on how far in the future they are. In the current format, I can't seem to make Excel realize which range I want to color.
Thanks!
hi,
you can format your cells to show them in the order that you want.
Right click then format cells
On custom, enter yymm as you suggested
hope that helps
Hi,
How about
formatted as mmm-yyyy=DATE(RIGHT(A1,2),LEFT(A1,2),1)
HTH
if your dates start in cell A2, you can put this in B2 and fill down:
=DATE(VALUE(20&RIGHT(A2,2)),VALUE(LEFT(A2,2)),1)
...however, this assumes that you don't have any years before 2000 and no years after 2099. After doing this, you can copy the new column, right click, Paste Special --> values --> OK to just keep the dates and not the formulas. Format in one of the Month-Year formats.
I believe Richard's suggestion will give Mar-1911. You could tweak it as follows to give Mar-2011
=DATE(RIGHT(A1,2)+100,LEFT(A1,2),1)
Hi ddll
Thanks for the correction - I hadn't spotted that. Which has actually identified what looks like a bug in Excel for Mac 2004.
There's a parameter setting whereby 2 digit year numbers less than the parameter digits are treated (or should be treated) as 21st century, whereas 2 digit numbers greater than the param are 20th C. e.g. with a parameter of 30, the system implies that =Date(11,1,1) will display 1st Jan 2011, whereas =date(31,1,1) will display 1st Jan 1931.
Is there a similar setting in Excel for Windows?
Rgds
Control Panel, Regional and Language Options, Regional Options, Customize, Date
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
It doesn't work that way for DATE function, Richard. If you use DATE(11,1,1) then you'll always get 1911. If the year is a number less than 1900 then it's always assumed that the year is that number + 1900 so both of these give the same date
=DATE(2011,1,1)
=DATE(111,1,1)
The parameter to which you refer only applies to dates typed like 1/1/11, which would be interpreted as 2011, or 1/1/31 which would be interpreted as 1931
Excellent ddll. Thanks for that clarification. You live and learn as they say....
Rgds
OK, you guys are awesome.
While I tried the first suggestion (Excel seems to turn the number into a date based on the number of days past 01 Jan 1900, so all the dates were pretty early), I'm going to try the other suggestions.
Thanks so much for all the help.
Edit:
OK, I have tried most of the suggestions and here are some of the results:
0311 (should be Mar-2011): Jul-2013
1210 (should be Dec-2010): Dec-2010 (Huzzah!)
0611 (should be Jun-2011): Jan-2016
0910 (should be Aug-2010): Jul-2017
So, it's a mixed bag, but each of the following gave the same results:
=DATE(RIGHT(A1,2),LEFT(A1,2),1)
=DATE(VALUE(20&RIGHT(A2,2)),VALUE(LEFT(A2,2)),1)
=DATE(RIGHT(A1,2)+100,LEFT(A1,2),1)
If I haven't mentioned it, I'm using Excel 2007, though that shouldn't matter much here.
So, if anyone has any more insight, I'd be very grateful. In fact, if I could just swap the first two digits and the last two digits, I feel I could achieve my goal.
More Edit:
OK, I've also tried:
=VALUE(RIGHT(L4,2)&LEFT(L4,2))
but this doesn't do it, either. Because I have added a "0" in front of the first nine months, the formula doesn't really work (0311 turns into 1131 for some reason). So, there are some solutions for the first nine months and some for the last three, but I'm having trouble finding that universal answer.
If I can get the numbers to read:
311 => 1103
1210 => 1012
611 => 1106
911 => 1009
I'd be in like Flynn.
Last edited by dogfood411; 01-20-2009 at 11:08 AM.
Try using this formula which will work even if the leading zero is the result of formatting
=DATE(RIGHT(A1,2)+100,LEFT(TEXT(A1,"0000"),2),1)
custom format result cell as mmm-yyyy
Fantastic!
I used DDL's suggestion and the angels started singing.
Thanks, all!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks