+ Reply to Thread
Results 1 to 3 of 3

Working out weeks from given date.

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    England
    MS-Off Ver
    Excel 2002
    Posts
    7

    Working out weeks from given date.

    Hi all,

    I have a requirement to work out the weeks from a date to current. So im using the following:

    =INT((D2-TODAY())/7)

    This does come up with a correct number of weeks but its a negative number.
    How can I resolve this.

    30/09/2002 =INT((D2-TODAY())/7) -395
    Last edited by mr_spaceuk; 04-21-2010 at 04:03 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Working out weeks from given date.

    as its always -ve just multiply by -1

    =INT((D2-TODAY())/7)*-1

    or =ABS(INT((D2-TODAY())/7))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Working out weeks from given date.

    or if D2 always <= current date simply swap the order in the subtraction.

+ 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