Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default convert a string of into a date format

Thanks it worked beautifully, but what if the fields are
blank, is there a way to modify this formula so that in
stead on a #value being returned nothing will return?
-----Original Message-----
Hi Fred,

"Fred" wrote in message
...
I have a a bunch of dates and time in column M that are
missing the /, I was wondering if it's possible to

convert
values of 08142003 12:30 into 08/14/2003 12:30. Any help
would be great, thanks :)


With one of those strings in cell M1, you could use a

formula like this to
get the date/time:

=DATE(MID(M1,5,4),LEFT(M1,2),MID(M1,3,2))+TIME(MI D

(M1,10,2),RIGHT(M1,2),0)

Of course, this assumes your data is consistent.

Regards,

Jake Marx
MS MVP - Excel


.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default convert a string of into a date format

Hi Fred,
=IF(M1="","", old formula )

which would provide an error if an empty or zero length
cell is not the only problem. So you would notice it immediately
and alter your formula to match the situation. If you just want to intercept
all errors you could use...

IF(ISERR(old formula),"", old formula)

Suggest reading HELP, index (tab), IS Functions

--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Fred" wrote in message ...
Thanks it worked beautifully, but what if the fields are
blank, is there a way to modify this formula so that in
stead on a #value being returned nothing will return?
-----Original Message-----
Hi Fred,

"Fred" wrote in message
...
I have a a bunch of dates and time in column M that are
missing the /, I was wondering if it's possible to

convert
values of 08142003 12:30 into 08/14/2003 12:30. Any help
would be great, thanks :)


With one of those strings in cell M1, you could use a

formula like this to
get the date/time:

=DATE(MID(M1,5,4),LEFT(M1,2),MID(M1,3,2))+TIME(MI D

(M1,10,2),RIGHT(M1,2),0)

Of course, this assumes your data is consistent.

Regards,

Jake Marx
MS MVP - Excel


.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default convert a string of into a date format

Fred,

You might want to consider using Len(M1)
=If(Len(M1)=0,.....
or
=If(Len(M1)<???....

steve

"David McRitchie" wrote in message
...
Hi Fred,
=IF(M1="","", old formula )

which would provide an error if an empty or zero length
cell is not the only problem. So you would notice it immediately
and alter your formula to match the situation. If you just want to

intercept
all errors you could use...

IF(ISERR(old formula),"", old formula)

Suggest reading HELP, index (tab), IS Functions

--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Fred" wrote in message

...
Thanks it worked beautifully, but what if the fields are
blank, is there a way to modify this formula so that in
stead on a #value being returned nothing will return?
-----Original Message-----
Hi Fred,

"Fred" wrote in message
...
I have a a bunch of dates and time in column M that are
missing the /, I was wondering if it's possible to

convert
values of 08142003 12:30 into 08/14/2003 12:30. Any help
would be great, thanks :)

With one of those strings in cell M1, you could use a

formula like this to
get the date/time:

=DATE(MID(M1,5,4),LEFT(M1,2),MID(M1,3,2))+TIME(MI D

(M1,10,2),RIGHT(M1,2),0)

Of course, this assumes your data is consistent.

Regards,

Jake Marx
MS MVP - Excel


.





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
Convert Date string to date format Joe M. Excel Discussion (Misc queries) 7 May 6th 10 02:46 PM
Convert worksheet string name to date format in cell Sabosis Excel Worksheet Functions 2 September 4th 09 05:49 PM
convert string to date Sean Excel Worksheet Functions 5 March 1st 06 09:54 PM
Convert Date to STring tonymaguire Excel Discussion (Misc queries) 9 February 15th 06 11:33 AM
Can i convert numbers into string format? talia_k Excel Discussion (Misc queries) 3 April 28th 05 03:27 PM


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