Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
RC
 
Posts: n/a
Default Add Dashes within aText String

I have a column of cells within Excel with different values, an example of
the text is like 20060602. I want them to be in the format 2006-06-02. Can
you suggest a formula to use
  #2   Report Post  
Posted to microsoft.public.excel.misc
MartinW
 
Posts: n/a
Default Add Dashes within aText String

Hi RC,

One way is to format the cells as custom 0000"-"00"-"00

HTH
Martin


  #3   Report Post  
Posted to microsoft.public.excel.misc
RC
 
Posts: n/a
Default Add Dashes within aText String

This appears to work and the cell appears as you say 2006-06-02. However, in
the formula bar the cell still reads 20060602. I cannot permanently change
the look even by using the cut n paste special (value) to another cell.
Any other ideas please

Thanks

Ron

"MartinW" wrote:

Hi RC,

One way is to format the cells as custom 0000"-"00"-"00

HTH
Martin



  #4   Report Post  
Posted to microsoft.public.excel.misc
ggl
 
Posts: n/a
Default Add Dashes within aText String


=concatenate(mid(a1;1;4);"-";mid(a1;5;2);"-";mid(a1;7;2))


--
ggl
------------------------------------------------------------------------
ggl's Profile: http://www.excelforum.com/member.php...o&userid=35591
View this thread: http://www.excelforum.com/showthread...hreadid=554472

  #5   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Add Dashes within aText String

"RC" wrote:
.. However, in the formula bar the cell still reads 20060602.
I cannot permanently change the look even
by using the cut n paste special (value) to another cell.


With source data (20060602) assumed representative and running in A1 down

Try in B1:
=LEFT(A1,4)&"-"&MID(A1,5,2)&"-"&RIGHT(A1,2)
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #6   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Add Dashes within aText String

Just a thought .. if what you're trying to do is get Excel to recognize the
source text data as real dates (the data looks like dates), then we could try
this ..

Select col A
Click Data Text to Columns
Click Next Next to proceed to step 3 of the wizard
In step 3,
check "Date" then select the format: YMD or YDM from the droplist,
click Finish
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #7   Report Post  
Posted to microsoft.public.excel.misc
MartinW
 
Posts: n/a
Default Add Dashes within aText String

Hi again RC

Maybe try this in B2 with your date in A1.

=LEFT(A1,4)&"-"&MID(A1,5,2)&"-"&RIGHT(A1,2)

HTH
Martin


  #8   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Add Dashes within aText String

On Thu, 22 Jun 2006 03:28:01 -0700, RC wrote:

I have a column of cells within Excel with different values, an example of
the text is like 20060602. I want them to be in the format 2006-06-02. Can
you suggest a formula to use



=TEXT(A3,"0000-00-00")

However, what do you want to do with the result? This will not be interpreted
as a date by Excel.


--ron
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 147
Default Add Dashes within aText String

Insert a column next to the data with A1 being the cell with the unformatted
data... enter this formula...
=CONCATENATE(LEFT(A1,4),"-",MID(A1,5,2),"-",RIGHT(A1,2)) --
then select the formula column and copy, then paste as values... then delete
the unformatted column
~Christine, CPA


"Ron Rosenfeld" wrote:

On Thu, 22 Jun 2006 03:28:01 -0700, RC wrote:

I have a column of cells within Excel with different values, an example of
the text is like 20060602. I want them to be in the format 2006-06-02. Can
you suggest a formula to use



=TEXT(A3,"0000-00-00")

However, what do you want to do with the result? This will not be interpreted
as a date by Excel.


--ron

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displays the number in text. (One thousand two hundred thirty four Ashish Patel Excel Worksheet Functions 1 March 20th 06 09:27 PM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
Browse File for Mac John Vickers Excel Discussion (Misc queries) 1 February 17th 06 06:23 PM
Auto convert an alphanumeric string (CIS9638S) to numbers only? Gary L Brown Excel Worksheet Functions 1 September 7th 05 01:17 AM
How do I use 3 cells to create the string for a lookup function? Bencomo Excel Worksheet Functions 1 May 15th 05 07:17 AM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"