# date extraction problem

1. ## date extraction problem

Hi all

I have a financial derivative thats named - X 1012 the number refers to its date of expiry, I want to extract the exact date of expiry. 10 refers to the 10th month (October), 2 is the year 2012, the 1 in the middle (and this is my problem) refers to the first week of the 10 month of 2012. the exact expiry is always on the wednesday of that week.

Extracting the month and year is easy, my problem is finding exact date from the wednesday of the week number.

Any help is appreciated

Thank you

2. ## Re: date extraction problem

Possibly something along the lines of ... with x 1012 in A1, try

=DATE(CONCATENATE(201,MID(A1,6,1)),1,(WEEKNUM(DATE(CONCATENATE(201,MID(A1,6,1)),MID(A1,3,2),1))+MID(A1,5,1))*7+4)

3. ## Re: date extraction problem

Hey dangelor

Thanx for the reply. nice idea! the date I received is the 10/17/2012 which is 2 weeks off, looking to get 10/3/2012...I didnt have time to figure out why the calculation at the end didnt work out, ill check it out later.

4. ## Re: date extraction problem

Did you solve this zack65?

I'm not sure how you are defining weeks, if half the week is in October and half in September then is that week 1 of October or the last week of September?Assuming that week 1 Wednesday is always the first Wednesday of the month, week 2 Wednesday is second Wednesday of the month etc. then try this formula

=DATE(RIGHT(A1)+110,MID(A1,3,2),MID(A1,5,1)*7+1)-WEEKDAY(DATE(RIGHT(A1)+110,MID(A1,3,2),4))

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1