Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default Converting yyyymm and yyyymmdd to "mmm dd, yyyy"

I'm trying to convert a string of numbers from a data dump in the yyyymm
format to a usable date. I'll be referencing it from another sheet and will
need it in the mmm-yy format in one section and in another mm-dd-yy.

The tough part is that it is a rolling 19 months of data and will change
every month. 01Month being the oldest and in the second month it drops off
and 02Month becomes the new 01Month. Additionally it is updated daily so the
19Month line is a "to-date" date in the yyyymmdd format.

I want to convert the data dump format into somethign usable.

Right now for the non-current months this works:

Constant Fr.Data Dump Convert to date (day 1 is dd)
01Month 200509 =DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),1)

The problem is that for the current month (ie 20070221 = Feb 21, 2007) the
conversion is 05/01/25. Obviously its wrong because of the logic, but how do
I write the last equation to get it to become Feb 21, 2007 on the current and
Feb 01, 2007 for the 18th month (using the first day as the dd)?

I tried this and it doesn't work.
=DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),IF(RIGHT(G21,
LEN(G21)-6)=0,1,RIGHT(G21, LEN(G21)-6)))
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Converting yyyymm and yyyymmdd to "mmm dd, yyyy"

You can use the MID function to get the month:
=DATE(LEFT(G3,4),MID(G3,5,2),IF(LEN(G3)=6,1,RIGHT( G3,2)))

James wrote:
I'm trying to convert a string of numbers from a data dump in the yyyymm
format to a usable date. I'll be referencing it from another sheet and will
need it in the mmm-yy format in one section and in another mm-dd-yy.

The tough part is that it is a rolling 19 months of data and will change
every month. 01Month being the oldest and in the second month it drops off
and 02Month becomes the new 01Month. Additionally it is updated daily so the
19Month line is a "to-date" date in the yyyymmdd format.

I want to convert the data dump format into somethign usable.

Right now for the non-current months this works:

Constant Fr.Data Dump Convert to date (day 1 is dd)
01Month 200509 =DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),1)

The problem is that for the current month (ie 20070221 = Feb 21, 2007) the
conversion is 05/01/25. Obviously its wrong because of the logic, but how do
I write the last equation to get it to become Feb 21, 2007 on the current and
Feb 01, 2007 for the 18th month (using the first day as the dd)?

I tried this and it doesn't work.
=DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),IF(RIGHT(G21,
LEN(G21)-6)=0,1,RIGHT(G21, LEN(G21)-6)))



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default Converting yyyymm and yyyymmdd to "mmm dd, yyyy"

as Borat would say..."Niiice!"

Thank you. That worked perfectly.

"Debra Dalgleish" wrote:

You can use the MID function to get the month:
=DATE(LEFT(G3,4),MID(G3,5,2),IF(LEN(G3)=6,1,RIGHT( G3,2)))

James wrote:
I'm trying to convert a string of numbers from a data dump in the yyyymm
format to a usable date. I'll be referencing it from another sheet and will
need it in the mmm-yy format in one section and in another mm-dd-yy.

The tough part is that it is a rolling 19 months of data and will change
every month. 01Month being the oldest and in the second month it drops off
and 02Month becomes the new 01Month. Additionally it is updated daily so the
19Month line is a "to-date" date in the yyyymmdd format.

I want to convert the data dump format into somethign usable.

Right now for the non-current months this works:

Constant Fr.Data Dump Convert to date (day 1 is dd)
01Month 200509 =DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),1)

The problem is that for the current month (ie 20070221 = Feb 21, 2007) the
conversion is 05/01/25. Obviously its wrong because of the logic, but how do
I write the last equation to get it to become Feb 21, 2007 on the current and
Feb 01, 2007 for the 18th month (using the first day as the dd)?

I tried this and it doesn't work.
=DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),IF(RIGHT(G21,
LEN(G21)-6)=0,1,RIGHT(G21, LEN(G21)-6)))



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Converting yyyymm and yyyymmdd to "mmm dd, yyyy"

You're welcome. High five!

James wrote:
as Borat would say..."Niiice!"

Thank you. That worked perfectly.

"Debra Dalgleish" wrote:


You can use the MID function to get the month:
=DATE(LEFT(G3,4),MID(G3,5,2),IF(LEN(G3)=6,1,RIGHT( G3,2)))

James wrote:

I'm trying to convert a string of numbers from a data dump in the yyyymm
format to a usable date. I'll be referencing it from another sheet and will
need it in the mmm-yy format in one section and in another mm-dd-yy.

The tough part is that it is a rolling 19 months of data and will change
every month. 01Month being the oldest and in the second month it drops off
and 02Month becomes the new 01Month. Additionally it is updated daily so the
19Month line is a "to-date" date in the yyyymmdd format.

I want to convert the data dump format into somethign usable.

Right now for the non-current months this works:

Constant Fr.Data Dump Convert to date (day 1 is dd)
01Month 200509 =DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),1)

The problem is that for the current month (ie 20070221 = Feb 21, 2007) the
conversion is 05/01/25. Obviously its wrong because of the logic, but how do
I write the last equation to get it to become Feb 21, 2007 on the current and
Feb 01, 2007 for the 18th month (using the first day as the dd)?

I tried this and it doesn't work.
=DATE(LEFT(G3,4),RIGHT(G3,LEN(G3)-4),IF(RIGHT(G21,
LEN(G21)-6)=0,1,RIGHT(G21, LEN(G21)-6)))



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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 text "date" (DDMMMYY) to datetime value of YYYY-MM-DD - ho j.a. harriman Excel Discussion (Misc queries) 7 March 29th 07 01:20 AM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Help Convert "MM/DD/YYYY" to "YY:DDD" Sam Excel Worksheet Functions 1 January 24th 06 11:58 AM
basically want to go from mm/dd/yyyy to yyyymmdd clegge Excel Worksheet Functions 2 January 10th 06 04:41 PM


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