+ Reply to Thread
Results 1 to 8 of 8

Formula for previous working week number

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    Notts
    MS-Off Ver
    Excel 2010
    Posts
    71

    Formula for previous working week number

    Hi,

    Does anyone have a formula that calculates the previous week number?
    The one I use for the current week number is:
    =1+INT((TODAY()-(DATE(YEAR(TODAY()),1,2)-WEEKDAY(DATE(YEAR(TODAY()),1,1))))/7)

    Although Im not 100% sure how to alter this.
    Do I have to change the '=1+INT' part to '=0+INT' ??

    Thank you in advance!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula for previous working week number

    Maybe

    =1+INT((TODAY()-(DATE(YEAR(TODAY()),1,2)-WEEKDAY(DATE(YEAR(TODAY()),1,1))))/7)-1
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    Notts
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Formula for previous working week number

    Quote Originally Posted by Fotis1991 View Post
    Maybe

    =1+INT((TODAY()-(DATE(YEAR(TODAY()),1,2)-WEEKDAY(DATE(YEAR(TODAY()),1,1))))/7)-1
    Hi Fotis,

    Unfortunately that is the formula that is giving me a problem. Because, last week that formula gave me week number '0' when it should have been week '52'.

    Because it takes the current week, (which was week 1), then -1, giving 0.


    Any other solutions?

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula for previous working week number

    Maybe..

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    Notts
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Formula for previous working week number

    But when it comes to week 1 again, wouldn't that just give me week 0 instead of 52?

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula for previous working week number

    In that case use
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-08-2012
    Location
    Notts
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Formula for previous working week number

    Thank you very much ACE!

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,720

    Re: Formula for previous working week number

    Old question, I know but the week number of the last day of 2012, as defined by WEEKNUM function, was 53 not 52 (and sometimes you can get 54). If you simply want the week number from the end of the last year you could try this:

    =IF(WEEKNUM(TODAY())=1,WEEKNUM(TODAY()-DAY(TODAY())),WEEKNUM(TODAY())-1)
    Audere est facere

+ 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