ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Change date to number (https://www.excelbanter.com/excel-worksheet-functions/113192-change-date-number.html)

maryj

Change date to number
 
Client has dates with custom format yyyymmdd. She needs the date to show in
that format but not be a date anymore. For example, the custom format
displays the date as 20061006 but she needs this value to display exactly
like this but no longer be a date. Everything I've tried keeps reading the
value as the serial number rather than literally what is displayed. I've
tried the text function, left and mid and right, and text to columns. Any
other suggestions??
--
maryj

Ron Rosenfeld

Change date to number
 
On Fri, 6 Oct 2006 09:59:02 -0700, maryj
wrote:

Client has dates with custom format yyyymmdd. She needs the date to show in
that format but not be a date anymore. For example, the custom format
displays the date as 20061006 but she needs this value to display exactly
like this but no longer be a date. Everything I've tried keeps reading the
value as the serial number rather than literally what is displayed. I've
tried the text function, left and mid and right, and text to columns. Any
other suggestions??


Since the contents is an actual date, perhaps this:

=YEAR(A1)*10^4+MONTH(A1)*100+DAY(A1)


--ron

vezerid

Change date to number
 
maryj,
the following formula will produce, in a separate cell, the same
display as in A2, only it is now text:
=TEXT(A2,"yyyymmdd")

If you want to use a column for further data entry, in which your entry
will not be interpreted as a date, format the cells as Text
(Format|Cells...|Number tab)

HTH
Kostis Vezerides


Alok

Change date to number
 
Try this
=CONCATENATE(YEAR(A1),TEXT(MONTH(A1),"00"),TEXT(DA Y(A1),"00"))
It will convert the date into text and keep the same format
Alok
"maryj" wrote:

Client has dates with custom format yyyymmdd. She needs the date to show in
that format but not be a date anymore. For example, the custom format
displays the date as 20061006 but she needs this value to display exactly
like this but no longer be a date. Everything I've tried keeps reading the
value as the serial number rather than literally what is displayed. I've
tried the text function, left and mid and right, and text to columns. Any
other suggestions??
--
maryj


Elkar

Change date to number
 
The TEXT function should work. Did you try it like this:

=TEXT(A1,"yyyymmdd")

HTH,
Elkar


"maryj" wrote:

Client has dates with custom format yyyymmdd. She needs the date to show in
that format but not be a date anymore. For example, the custom format
displays the date as 20061006 but she needs this value to display exactly
like this but no longer be a date. Everything I've tried keeps reading the
value as the serial number rather than literally what is displayed. I've
tried the text function, left and mid and right, and text to columns. Any
other suggestions??
--
maryj


maryj

Change date to number
 
Thank you!!! Forgot about setting the format in the text function like that!
--
maryj


"vezerid" wrote:

maryj,
the following formula will produce, in a separate cell, the same
display as in A2, only it is now text:
=TEXT(A2,"yyyymmdd")

If you want to use a column for further data entry, in which your entry
will not be interpreted as a date, format the cells as Text
(Format|Cells...|Number tab)

HTH
Kostis Vezerides




All times are GMT +1. The time now is 11:06 PM.

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