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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date conversion to text

Status
Not open for further replies.

gnanas

Technical User
Mar 20, 2003
22
AU
I regularly import information from a maintenance database into Xcel for analysis. of teh database one column consists of date in dd/mm/yyyy hh:mm format. I then need to convert this column to yyyymm format. But I want this column to appear as text or number (e.g 200306). Even though cells appear in yyyymm format the formula remains dd/mm/yyyy hh:mm I tried various methods to convert the first cloumn to number/text in the style I wanted without any success Can some one help me

Regards


Gnanas
 
Hi Gnanas,

With an Excel date in B3 (not a text field) then try this formula:

=YEAR(B3)&TEXT(B3,"mm")

or

=TEXT(B3,"yyyy")&TEXT(B3,"mm")

The result is appears to be a text field as it is left justified, but this should not be a problem for sorting.

Good Luck,

Peter Moran
Two heads are always better than one!
 
Hi PeterMoran,

Your second formula worked very well

Thank you very much

Gnanas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top