Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
MCI MCI is offline
external usenet poster
 
Posts: 11
Default Covert string to date, etc

Hi guys, just can't figure this out:

1. Suppose I have 100 rows of data, rows are such as:
"ABMAR99", "ABMAR02", "ABDEC03", etc.

How to convert for example, "ABMAR99" to the first wednesday
in March 1999, which is, "1999-03-03"?

2. Suppose other than rows like "ABMAR99", "ABMAR02", "ABDEC03", I also
have rows like "AB_MLTE", "ABMAR2C0",etc, and I only want to keep the
rows
in the format ("ABMAR99", "ABMAR02", "ABDEC03").

In other words:

(1) I only want to keep rows with the exact length of 7.
(2) For rows with the exact length of 7, I want to delete rows whose
third letter is "_".

Thanks a lot, appreciate your help!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Covert string to date, etc

Hi,
Suppose, Column A contains that date code, Column B will be the helper
column, and Column C will be the answer

A2: ABMAR99
at B2, type the following formula:
=IF(OR(LEN(A2)7,MID(A2,3,1)="_"),"please
delete",DATE(IF(VALUE(RIGHT(A2,2))<=20,2000+RIGHT( A2,2),1900+RIGHT(A2,2)),VLOOKUP(MID(A2,3,3),{"jan" ,1;"feb",2;"mar",3;"apr",4;"may",5;"jun",6;"jul",7 ;"aug",8;"sep",9;"oct",10;"nov",11;"dec",12},2,FAL SE),1))

at C2, type the following formula:
=IF(B2="please
delete","",TEXT(IF(WEEKDAY(B2,1)<=4,DATE(YEAR(B2), MONTH(B2),5-WEEKDAY(B2,1)),DATE(YEAR(B2),MONTH(B2),12-WEEKDAY(B2,1))),"yyyy-mm-dd"))

then sort the helper column, and delete the rows

Bobocat

"MCI" wrote in message
ups.com...
Hi guys, just can't figure this out:

1. Suppose I have 100 rows of data, rows are such as:
"ABMAR99", "ABMAR02", "ABDEC03", etc.

How to convert for example, "ABMAR99" to the first wednesday
in March 1999, which is, "1999-03-03"?

2. Suppose other than rows like "ABMAR99", "ABMAR02", "ABDEC03", I also
have rows like "AB_MLTE", "ABMAR2C0",etc, and I only want to keep the
rows
in the format ("ABMAR99", "ABMAR02", "ABDEC03").

In other words:

(1) I only want to keep rows with the exact length of 7.
(2) For rows with the exact length of 7, I want to delete rows whose
third letter is "_".

Thanks a lot, appreciate your help!



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
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
convert string to date Sean Excel Worksheet Functions 5 March 1st 06 09:54 PM
Convert text string to date AK Excel Worksheet Functions 1 February 1st 06 06:27 PM
Lookup the month in a date string 01/03/05 Una Excel Worksheet Functions 1 March 30th 05 09:45 AM


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