+ Reply to Thread
Results 1 to 2 of 2

Create Function To Change Date into Week Number

Hybrid View

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Question Create Function To Change Date into Week Number

    Hi All,

    Im trying to save myself some time and create loads of new functions in my Perosnal macro workbook.

    At the moment i'm trying to create a function that converts a given date into its corresponding week number.

    i know the formula to do this is as follows:

    =TRUNC(A1-Date(Year(A1),0,0)+6))/7)
    Where A1 = the cell reference that contains the date.

    Obviously my function would start as follows:

    Function WeeknUmber(Date1)
         WeekNumber = ???????
    I'm just not sure on how to work the formula into this function?

    Please help

    thanks for reading my thread everyone
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  2. #2
    Registered User
    Join Date
    04-02-2007
    Posts
    35

    weeknum

    there is just a weeknum function

    =WEEKNUM(A1,1) or =WEEKNUM(A1,2)

    The 1 / 2 at the end determins if it takes week start to be sat or sun

+ 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