+ Reply to Thread
Results 1 to 8 of 8

date output

  1. #1
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    date output

    hi guys
    i have this problem
    in cell d20 i have a contract date
    in cell d21 i have a lead time
    this will always be in the format eg(2-3 weeks)
    in cell d22 i would like it to tell me d20 plus the first number of weeks ( before the hyphen)
    and in d23 the second number of the weeksafter the hyphen
    if you could help it would be great
    Last edited by excellentexcel; 05-19-2009 at 11:49 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: date output

    Try:

    =D20+LEFT(D21,FIND("-",D21)-1)*7

    and

    =D20+MID(D21,FIND("-",D21)+1,FIND(" ",D21)-FIND("-",D21))*7
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: date output

    Hi

    in D22
    =D20+LEFT(D21,FIND("-",D21)-1)*7

    in D23
    =D20+MID(D21,FIND("-",D21)+1,2)*7

    I and assuming there will never be more than 99 weeks, and that there will always be a space between the the last number and the "w" of weeks
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: date output

    thanks nbvc
    is there anyway to make this a little more advanced and return the week commencing date

    ie if the answer is 19th may 2009

    it returns w/c 18/05/09

    thanks

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: date output

    Try:

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: date output

    Quote Originally Posted by excellentexcel View Post
    thanks nbvc
    is there anyway to make this a little more advanced and return the week commencing date

    ie if the answer is 19th may 2009

    it returns w/c 18/05/09

    thanks
    D22
    ="w/c "&TEXT((D20+LEFT(D21,FIND("-",D21)-1)*7)+2-WEEKDAY((D20+LEFT(D21,FIND("-",D21)-1)*7)),"dd/mm/yy")

    and
    D23
    ="w/c "&TEXT(D20+MID(D21,FIND("-",D21)+1,2)*7+2-WEEKDAY(D20+MID(D21,FIND("-",D21)+1,2)*7),"dd/mm/yy")

  7. #7
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: date output

    superb
    thanks very much

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: date output

    Well, yes, if you want the "w/c" in the cell too.. you would have to add the TEXT() function around MY formulas to get the date to look like a date rather than a serial number....

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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