+ Reply to Thread
Results 1 to 6 of 6

how to calculate the number of weeks between 2 weeks

  1. #1
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    how to calculate the number of weeks between 2 weeks

    Hello,

    Could you please give me advice to calculate the number of weeks (Duration) between 2 weeks? My problem is that the format of week is WW.YYYY and the formula should consider the year as well.
    Thank you for any support you can offer.

    Here is an example with the desired results (I hope this is possible somehow):

    Start End Duration
    06.2020 08.2020 3 weeks
    51.2020 02.2021 5 weeks

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,430

    Re: how to calculate the number of weeks between 2 weeks

    your two suggested answers are at odds with each other. The answers should be 3 and 4 respectively.

    =(RIGHT(B3,4)-RIGHT(A3,4))*52+VALUE(LEFT(B3,2))-VALUE(LEFT(A3,2))+1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    Re: how to calculate the number of weeks between 2 weeks

    Hi AliGW,

    Thank you very much for your quick answer. I have an issue with your formula regarding the second case.
    Week 51.2020 starts on 14.12.2020 and week 02.2021 ends on 17.01.2021, we have 35 days between 14.12.2020 and 17.01.2020, so the duration is 5 weeks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,430

    Re: how to calculate the number of weeks between 2 weeks

    OK - so it can't be done without proper dates, then, and the data sample you have provided is inadequate.

  5. #5
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    Re: how to calculate the number of weeks between 2 weeks

    Thank you the help AliGW, you solved the 50% of my problem.
    I wait if somebody can offer other formula for the second case.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,430

    Re: how to calculate the number of weeks between 2 weeks

    FYI the ww.yyyy text formatting does not exist - ww is not recognised. You can use d, m and y for date formatting.

    As I said, you need proper dates to be able to do this. Excel cannot determine from text when in the week it is meant to be - it is only text, not a date value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Add 12 weeks to date to return week number turn over at 52 weeks
    By nigelog in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2017, 05:58 AM
  2. Calculate the first Saturday for a specific number of weeks after
    By mklindquist0815 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2015, 09:16 PM
  3. Calculate number of weeks between two dates
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-17-2015, 12:11 PM
  4. [SOLVED] Trying to calculate the number of months AND weeks between two dates..
    By DigitalWavez in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-01-2014, 04:43 PM
  5. Calculate the number of weeks between two dates
    By marsham in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-04-2013, 06:39 PM
  6. Calculate number of weeks
    By tgeorgebglr in forum Excel General
    Replies: 1
    Last Post: 08-06-2007, 05:27 PM
  7. [SOLVED] HOW TO CALCULATE NUMBER OF WEEKS BETWEEN TWO GIVEN DATES(MAY BE .
    By WARRENCHERYL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-05-2005, 05:06 AM

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