How to convert string to date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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:
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top