Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert date to text in MS Excel

Status
Not open for further replies.

2Plan

MIS
Mar 29, 2005
55
US
Is there an easy way to convert this date '8/15/2007' to '081507'?

The dates are MS Excel.
 



Hi,

If you have REAL DATES, then use the TEXT function...
[tt]
=TEXT(yourdateref,"mmddyy")
[/tt]


Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 



...FYI, mmddyy will NOT sort as expected.

Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 



...you also could format your date field/column as Format > Cells - Number Tab - Custom...
[tt]
"mmddyy"
[/tt]


Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 
Works great!

You guys are goood.
Thanks.
 
As Skip pointed out, sorting on mmddyy when it is stored as text won't work as expected.

Consider the format YYYYMMDD. That will sort by date, even if stored as text.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top