Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 201
Default How to convert string to date

Hello,

I have a string in Col H that is like this: 20021002.

I want it to show in Col I as 10/02/02, but I don't want it to be in date
format, just text format. However, if I DID want it date format, can you
also put what that would be as well?

What do you suggest?

TIA,

Phil
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default How to convert string to date

hi Phil

=date(left(a2,4),mid(a2,5,2),right(a2,2))

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Phil" escreveu:

Hello,

I have a string in Col H that is like this: 20021002.

I want it to show in Col I as 10/02/02, but I don't want it to be in date
format, just text format. However, if I DID want it date format, can you
also put what that would be as well?

What do you suggest?

TIA,

Phil

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 176
Default How to convert string to date

Assume cell A1:

To output as text:
=TEXT(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)),"mm/dd/yyyy")

To output as date:
=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))
Then:
<Format
<Cells
"Custom" tab
enter: mm/dd/yyyy

--
Regards,
Dave


"Phil" wrote:

Hello,

I have a string in Col H that is like this: 20021002.

I want it to show in Col I as 10/02/02, but I don't want it to be in date
format, just text format. However, if I DID want it date format, can you
also put what that would be as well?

What do you suggest?

TIA,

Phil

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
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
search for date in long string of text ryan00davis Excel Discussion (Misc queries) 4 August 11th 06 07:06 PM
How do I grab the date from a text string? [email protected] Excel Worksheet Functions 4 June 6th 06 07:55 AM
Need help: convert seconds to date and time misty1 Excel Discussion (Misc queries) 2 November 26th 05 04:12 AM
How to convert string to a date galsaba Excel Worksheet Functions 3 March 4th 05 05:20 PM


All times are GMT +1. The time now is 06:33 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"