+ Reply to Thread
Results 1 to 15 of 15

Calculate Financial Week No

  1. #1
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Calculate Financial Week No

    Hi All,
    having problems calculating the Financial week no for a row of cells for a new.

    Column A = Date. (e.g.1 Apr 2013)
    Column B = Financial Week ( If 1 Apr = wk 1)


    What I am using below here is based on calendar week. But I want to convert this to Financial week.

    =INT((A1-DATE(YEAR(A1-WEEKDAY(A1-1)+4),1,3)+WEEKDAY(DATE(YEAR(A1-WEEKDAY(A1-1)+4),1,3))+5)/7)


    My financial Year starts on 1 Apr of ever year.
    Starts on Mon and Ends on Sun.
    It is based on Calendar Style 4-4-5.

    Using either function or Macro is fine.

    Any Help is appreciated!

    Regards,
    Nironto
    Attached Images Attached Images

  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: Calculate Financial Week No

    Pictures are nice but a small sample workbook will be much more useful.
    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
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Attached Sheet for Easier understanding.

    Now Column A = Dates, B = Calendar Week, Now I put in Financial Week in Column C.
    Instead of keying in Manually. I need a method / function to compute the Financial Weeks in Column C.


    Regards,
    Nironto
    Attached Files Attached Files

  4. #4
    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: Calculate Financial Week No

    Try in A2 and copy down this(modified) ddl's formula.

    =INT((A2-WEEKDAY(A2)-DATE(YEAR(A2+DATE(1,1,2)-DATE(0,4,0)-WEEKDAY(A2))-1,4,0)+8)/7)

  5. #5
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Thanks Fotis1991!
    Few Issues.

    Issue 1
    Week 1 = Apr 1 to Apr 7.
    Yours is at Apr 1 to Apr 6.

    Issue 2
    And when it comes to 1 Apr of every year, (In this case 2014)
    It should restart as week 1.
    You may refer to the picture snapshot of how the Financial week based on 4-4-5 for 2013 for how it looks like.

    Regards,
    Nironto

  6. #6
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Thanks for trying. I know this is a guru level challenge.

  7. #7
    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: Calculate Financial Week No

    Quote Originally Posted by nironto View Post
    Thanks for trying. I know this is a guru level challenge.
    You know, when i'll grow up i want to be a Guru.

    In the meantime see if the suggestion of an insignificant VFC, works for you..

    =IF(A2>=DATE(YEAR(A2),4,1),TRUNC((A2-DATE(YEAR(A2),4,1)+364)/7)+1-52,TRUNC((A2-DATE(YEAR(A2),4,1)+364)/7)+1)

  8. #8
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Hi Fotis1991,
    Thanks. My friends and I been trying whole day and we concluded it really tested our wits and is beyond us or is even doable??.
    I had solutions provided by you before and have been very impressed by your expertise. No doubt, you are a guru and we also wanted to be like you.

    I had left office and I'll let you know the first thing in the morning. Many Thanks!

    Regards,
    Nironto

  9. #9
    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: Calculate Financial Week No

    Quote Originally Posted by nironto View Post
    Hi Fotis1991,
    Thanks.

    I had left office and I'll let you know the first thing in the morning. Many Thanks!

    Regards,
    Nironto
    You are welcome. I'll be here waiting..

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

    Re: Calculate Financial Week No

    Quote Originally Posted by nironto View Post
    It is based on Calendar Style 4-4-5.
    Is that relevant here, do you want the week numbers to keep progressing up to 52/53 next March?

    This year April 1st happens to be a Monday, when does week 1 start when that isn't the case, is it still on 1st April but then week 2 starts on first Monday after that (or does week 1 start in March, is there a general rule?)
    Audere est facere

  11. #11
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Hi daddylonglegs,
    Yes. There is week 53.

    I have attached the Financial Week Calendar (See the tab)--Refer to updated Excel Sheet
    The Financial week always begins on Monday and ends Sun.
    It resets on 1 apr every year as week 1.
    ( though it may not always fall on Monday. which means e.g. week 1 of yr 2014 may only have 6 days).

    Hi Fotis1991,
    Really appreciate your help! You are getting very close. (If you refer to the Grey columns which is the actual result and compare the formula values.)
    The formula is correct till it reaches the new year of 2014.

    This calendar thingy is beyond my level and is killing me. Thanks to all for helping.

    Regards,
    Nironto
    Attached Files Attached Files

  12. #12
    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: Calculate Financial Week No

    As the absolute master of dates(ddl), dealt with your thread, be sure that you will find your solution.

    In the meantime this works for me(i'll keep looking to improve it)

    Row 2:row 8, this formula.

    =IF(A2>=DATE(YEAR(A2);4;1);TRUNC((A2-DATE(YEAR(A2);4;1)+364)/7)+1-52;TRUNC((A2-DATE(YEAR(A2);4;1)+365)/7)+1)

    From row 9 and down this one.

    =IF(AND(DAY(A9)=7;MONTH(A9)=4);F8+1;IF(A9>=DATE(YEAR(A9);4;1);TRUNC((A9-DATE(YEAR(A9);4;1)+364)/7)+1-52;TRUNC((A9-DATE(YEAR(A9);4;1)+365)/7)+1))

    Maybe needs to modify the red highlighted part of the formula to 1, as in my computer Monday is the day number 7 and not 1 as propably in your computer...
    Attached Files Attached Files

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

    Re: Calculate Financial Week No

    With date in A2 this formula should work for any date in any year

    =INT((A2-WEEKDAY(A2-1)-DATE(YEAR(A2+275)-1,4,1))/7)+2

    (275 is the number of days between 1st April and the end of the year)
    Last edited by daddylonglegs; 06-04-2013 at 04:56 AM.

  14. #14
    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: Calculate Financial Week No

    Teacher. Perhaps an explanation of how it works? Specially the second part?

  15. #15
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Calculate Financial Week No

    Thanks daddylonglegs and Fotis1991!
    You guys are awesome! A living legend!

    I thought this is mission impossible but you guys made my day!
    I had learn something along the way too!
    Yeah, can you explain more on your logic ?

    I'll update this thread as solved.

    Regards,
    Nironto

+ 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