+ Reply to Thread
Results 1 to 17 of 17

Calculate week number for Fiscal Year Dates

  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    11

    Calculate week number for Fiscal Year Dates

    My fiscal year starts on October 1st and I have a total of 53 weeks in a year. Saturday is considered the first day of the week. How do I calculate the week number of a specific date? For instance, if the date is 4/10/2010, the week number should be 29.
    Last edited by katie_10042; 04-26-2010 at 05:05 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculate week number for Fiscal Year Dates

    Try this formula
    =53-WEEKNUM(DATE(YEAR(B1)-1,10,1))+WEEKNUM(B1)
    where your current date is in B1. It does however give me 28 with your example. Double check your count. If it really is 29, then modify the formula with +1. Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Calculate week number for Fiscal Year Dates

    EDIT: deleted formula
    Last edited by Palmetto; 04-26-2010 at 03:42 PM. Reason: formula does not return correct result
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculate week number for Fiscal Year Dates

    Oh, My formula will only work up until October 1st. Oppps, it expands to
    =IF(MONTH(B1)>=10,WEEKNUM(B1)-WEEKNUM(DATE(YEAR(B1),10,1))+1,53-WEEKNUM(DATE(YEAR(B1)-1,10,1))+WEEKNUM(B1))

    I'm thinking someone here can simplify.

  5. #5
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Calculate week number for Fiscal Year Dates

    Try this,

    A1=04/10/2010

    =INT((A1-WEEKDAY(A1+1)-DATE(YEAR(A1+7-WEEKDAY(A1+1))-(MONTH(A1)<10),10,1))/7)+2

    Reagards

  6. #6
    Registered User
    Join Date
    04-26-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Calculate week number for Fiscal Year Dates

    Thanks sailepaty! The formula works perfectly!

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculate week number for Fiscal Year Dates

    If A1 is 31st December 2011 sailepaty's formula returns -38, and you get similar results for the last few days of some other years.

    Assuming your week numbers are defined as follows:

    week 1 starts on 1st October then week 2 starts on the next Saturday after that, then you can use this formula to get the week numbers

    =INT((A1-DATE(YEAR(A1+92)-1,10,1)-WEEKDAY(A1+1))/7)+2

    Like WEEKNUM function that formula can give you 54 in certain circumstances (only on 30th Sept if that day is a Saturday and the year is a leap year - although the next one isn't until 2028!)

  8. #8
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Calculate week number for Fiscal Year Dates

    Quote Originally Posted by daddylonglegs View Post
    If A1 is 31st December 2011 sailepaty's formula returns -38, and you get similar results for the last few days of some other years.
    I think this one works better.

    =INT((A1-WEEKDAY(A1+1)-DATE(YEAR(A1)-(MONTH(A1)<10),10,1))/7)+2

    Reagrds

  9. #9
    Registered User
    Join Date
    04-26-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Calculate week number for Fiscal Year Dates

    Thanks! Can you show me how to put this formula in Access? Need to replace A1 with [sample1]![Date]. I keep getting this error "The expression you entered has a function containing the wrong number of arguments”. Not sure if it's due to not having the correct parenthesis around correct field or not enough parentheses or if I'm missing an IIF statement near the month part of the formula.

  10. #10
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Calculate week number for Fiscal Year Dates

    Maybe this works,

    WN:Int(([Sample1]![Date]-Weekday([Sample1]![Date]+1)-DateSerial(Year([Sample1]![Date])-IIf(Month([Sample1]![Date])<10,1,0),10,1))/7)+2

    Regards

  11. #11
    Registered User
    Join Date
    04-26-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Calculate week number for Fiscal Year Dates

    Works perfectly! Thanks!

  12. #12
    Registered User
    Join Date
    07-23-2012
    Location
    uk
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    6

    Re: Calculate week number for Fiscal Year Dates

    This didn't help me much as a UK user. So, taking into account the European standard that defines the first week as the one with the majority of days (four or more) falling in the new year, I cooked up this:


    =ROUNDDOWN(IF(A1<IF(IF(WEEKDAY(DATE(YEAR(A1),4,1),2)>4,1,2)=1,DATE(YEAR(A1),4,1)+(8-WEEKDAY(DATE(YEAR(A1),4,1),2)),IF(IF(WEEKDAY(DATE(YEAR(A1),4,1),2)>4,1,2)=2,DATE(YEAR(A1),4,1)+(1-WEEKDAY(DATE(YEAR(A1),4,1),2)),"")),((A1-IF(IF(WEEKDAY(DATE(YEAR(A1)-1,4,1),2)>4,1,2)=1,DATE(YEAR(A1)-1,4,1)+(8-WEEKDAY(DATE(YEAR(A1)-1,4,1),2)),IF(IF(WEEKDAY(DATE(YEAR(A1)-1,4,1),2)>4,1,2)=2,DATE(YEAR(A1)-1,4,1)+(1-WEEKDAY(DATE(YEAR(A1)-1,4,1),2)),"")))/7)+1,((A1-IF(IF(WEEKDAY(DATE(YEAR(A1),4,1),2)>4,1,2)=1,DATE(YEAR(A1),4,1)+(8-WEEKDAY(DATE(YEAR(A1),4,1),2)),IF(IF(WEEKDAY(DATE(YEAR(A1),4,1),2)>4,1,2)=2,DATE(YEAR(A1),4,1)+(1-WEEKDAY(DATE(YEAR(A1),4,1),2)),"")))/7)+1),0)

  13. #13
    Registered User
    Join Date
    12-30-2015
    Location
    London
    MS-Off Ver
    365
    Posts
    2

    Re: Calculate week number for Fiscal Year Dates

    Thanks for this. Works perfectly!

  14. #14
    Registered User
    Join Date
    12-30-2015
    Location
    London
    MS-Off Ver
    365
    Posts
    2

    Re: Calculate week number for Fiscal Year Dates

    Dear owstie. Thanks for this. Works perfectly!

  15. #15
    Registered User
    Join Date
    12-14-2016
    Location
    Brooklyn, NY
    MS-Off Ver
    2016
    Posts
    1

    Re: Calculate week number for Fiscal Year Dates

    I used form formulas above so i can calculate fiscal weeks for a fiscal year that starts July 10th 2016 and ends July 8th 2017, but as soon as the date year changes to 2017 i am getting negative numbers. or in some of the other formulas, I am getting the wrong fiscal weeks. can anyone help me out.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Calculate week number for Fiscal Year Dates

    ILP welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  17. #17
    Registered User
    Join Date
    02-14-2017
    Location
    gauteng pretoria
    MS-Off Ver
    13
    Posts
    1

    Re: Calculate week number for Fiscal Year Dates

    hi,

    i need to calculate the fiscal/financial weeks
    my month start from april but my first week is from the 28/02/2016 -03/04/2016.
    please help

+ 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