ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Coverting Dates to Text (https://www.excelbanter.com/excel-programming/322440-coverting-dates-text.html)

Scott

Coverting Dates to Text
 
I've got a column that contains cells like 0-04-1, which is a text code with
a dash delimiter. But Excel converts them to dates when the figures get
imported from a file.

Can someone help me create a formula that could convert 1/4/2001 to 0-04-01?

Another example would be:

1/6/2001 should be 0-06-1



Bob Phillips[_6_]

Coverting Dates to Text
 
Scott,

Try =TEXT(A1,"d-mm-y")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
I've got a column that contains cells like 0-04-1, which is a text code

with
a dash delimiter. But Excel converts them to dates when the figures get
imported from a file.

Can someone help me create a formula that could convert 1/4/2001 to

0-04-01?

Another example would be:

1/6/2001 should be 0-06-1





Scott

Coverting Dates to Text
 
It almost works, but here's the results.

EXAMPLE 1:
' below is a correct entry and then your formula result which is good
0-04-1 returns 0-04-1

EXAMPLE 2
' below is an incorrect entry and then your formula result which is bad
1/4/2001 returns 4-01-01

EXAMPLE 2 result should end up like EXAMPLE 1. That is both should return
0-04-1





"Bob Phillips" wrote in message
...
Scott,

Try =TEXT(A1,"d-mm-y")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
I've got a column that contains cells like 0-04-1, which is a text code

with
a dash delimiter. But Excel converts them to dates when the figures get
imported from a file.

Can someone help me create a formula that could convert 1/4/2001 to

0-04-01?

Another example would be:

1/6/2001 should be 0-06-1







Bob Phillips[_6_]

Coverting Dates to Text
 
Sorry Scott, the format will always give at least 2 year digits.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
It almost works, but here's the results.

EXAMPLE 1:
' below is a correct entry and then your formula result which is good
0-04-1 returns 0-04-1

EXAMPLE 2
' below is an incorrect entry and then your formula result which is bad
1/4/2001 returns 4-01-01

EXAMPLE 2 result should end up like EXAMPLE 1. That is both should return
0-04-1





"Bob Phillips" wrote in message
...
Scott,

Try =TEXT(A1,"d-mm-y")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
I've got a column that contains cells like 0-04-1, which is a text code

with
a dash delimiter. But Excel converts them to dates when the figures get
imported from a file.

Can someone help me create a formula that could convert 1/4/2001 to

0-04-01?

Another example would be:

1/6/2001 should be 0-06-1









Scott

Coverting Dates to Text
 
No sweat, I figured a way around it. Thanks for your help.


"Bob Phillips" wrote in message
...
Sorry Scott, the format will always give at least 2 year digits.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
It almost works, but here's the results.

EXAMPLE 1:
' below is a correct entry and then your formula result which is good
0-04-1 returns 0-04-1

EXAMPLE 2
' below is an incorrect entry and then your formula result which is bad
1/4/2001 returns 4-01-01

EXAMPLE 2 result should end up like EXAMPLE 1. That is both should return
0-04-1





"Bob Phillips" wrote in message
...
Scott,

Try =TEXT(A1,"d-mm-y")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"scott" wrote in message
...
I've got a column that contains cells like 0-04-1, which is a text
code
with
a dash delimiter. But Excel converts them to dates when the figures
get
imported from a file.

Can someone help me create a formula that could convert 1/4/2001 to
0-04-01?

Another example would be:

1/6/2001 should be 0-06-1












All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com