Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default format a column with a function

I am trying to convert a column of dates that come in the format "20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I will
include it in another one)

problem, the data is imported which means that is comes in "general" format
and needs to be in either "text" or "number" format for me to use any of the
functions like VALUE... how can I change to entire coulmn with a function so
that it converts the data to correct format? (without using TEXT TO COLUMS)

thx




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 320
Default format a column with a function

How about Formatting it as 0000-00-00
??

"spreadsheet monkey" wrote:

I am trying to convert a column of dates that come in the format "20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I will
include it in another one)

problem, the data is imported which means that is comes in "general" format
and needs to be in either "text" or "number" format for me to use any of the
functions like VALUE... how can I change to entire coulmn with a function so
that it converts the data to correct format? (without using TEXT TO COLUMS)

thx




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default format a column with a function

=--TEXT(A1,"0000\-00\-00")


then format as date (important)

it works as long as a date like Feb 1 2005 comes over as

20050201

and not

200521


--


Regards,


Peo Sjoblom


"spreadsheet monkey" wrote in
message ...
I am trying to convert a column of dates that come in the format "20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I
will
include it in another one)

problem, the data is imported which means that is comes in "general"
format
and needs to be in either "text" or "number" format for me to use any of
the
functions like VALUE... how can I change to entire coulmn with a function
so
that it converts the data to correct format? (without using TEXT TO
COLUMS)

thx






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default format a column with a function

While that would display it correctly it would also prevent the OP from
doing any date calculations using YEAR, MONTH etc


--


Regards,


Peo Sjoblom



"Bob Umlas, Excel MVP" wrote in
message ...
How about Formatting it as 0000-00-00
??

"spreadsheet monkey" wrote:

I am trying to convert a column of dates that come in the format
"20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I
will
include it in another one)

problem, the data is imported which means that is comes in "general"
format
and needs to be in either "text" or "number" format for me to use any of
the
functions like VALUE... how can I change to entire coulmn with a function
so
that it converts the data to correct format? (without using TEXT TO
COLUMS)

thx






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default format a column with a function

If you merely wish to display the number 20071101 as 2007-11-01, you can use
the custom format 0000-00-00, or if you want to turn it into text in that
format you can use =TEXT(A1,"0000-00-00")
If you want to convert it to an Excel date for calculations, you could use
the formula =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)), and format the result
as yyyy-mm-dd
--
David Biddulph

"spreadsheet monkey" wrote in
message ...
I am trying to convert a column of dates that come in the format "20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I
will
include it in another one)

problem, the data is imported which means that is comes in "general"
format
and needs to be in either "text" or "number" format for me to use any of
the
functions like VALUE... how can I change to entire coulmn with a function
so
that it converts the data to correct format? (without using TEXT TO
COLUMS)

thx





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default format a column with a function

You can actually convert it by using the simpler

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


--


Regards,


Peo Sjoblom



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If you merely wish to display the number 20071101 as 2007-11-01, you can
use the custom format 0000-00-00, or if you want to turn it into text in
that format you can use =TEXT(A1,"0000-00-00")
If you want to convert it to an Excel date for calculations, you could use
the formula =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)), and format the
result as yyyy-mm-dd
--
David Biddulph

"spreadsheet monkey" wrote
in message ...
I am trying to convert a column of dates that come in the format
"20071101"
into
"2007-11-01" in an automated fashion (if possible in a formula since I
will
include it in another one)

problem, the data is imported which means that is comes in "general"
format
and needs to be in either "text" or "number" format for me to use any of
the
functions like VALUE... how can I change to entire coulmn with a function
so
that it converts the data to correct format? (without using TEXT TO
COLUMS)

thx





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
How do I format the A/ B Column to be fixed like numeric column RYarn Excel Worksheet Functions 1 August 17th 07 02:18 AM
How do I format the A/ B Column to be fixed like numeric column bj Excel Worksheet Functions 0 August 17th 07 02:04 AM
How do I format the A/ B Column to be fixed like numeric column April Excel Worksheet Functions 0 August 17th 07 01:57 AM
Label Format to Column Format drakehouse Excel Discussion (Misc queries) 3 November 14th 06 12:30 AM
Format Column with Same Function Brett Patterson Excel Worksheet Functions 6 January 5th 05 07:43 PM


All times are GMT +1. The time now is 08:52 AM.

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

About Us

"It's about Microsoft Excel"