+ Reply to Thread
Results 1 to 7 of 7

[SOLVED] Creating week number starting on Jan 1 to Jan 7 as week one

Hybrid View

jackson_hollon [SOLVED] Creating week number... 12-10-2014, 05:16 AM
samba_ravi Re: Creating week number... 12-10-2014, 05:25 AM
samba_ravi Re: Creating week number... 12-10-2014, 05:26 AM
Md Aejaz Re: Creating week number... 12-10-2014, 05:38 AM
Special-K Re: Creating week number... 12-10-2014, 06:00 AM
daddylonglegs Re: Creating week number... 12-10-2014, 09:28 AM
jackson_hollon Re: Creating week number... 12-12-2014, 03:13 AM
  1. #1
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    [SOLVED] Creating week number starting on Jan 1 to Jan 7 as week one

    My boss wants me to create a spreadsheet with any given date and return week number that starting on Jan 1 to Jan 7 as week one and so forth.

    For example, putting Jan 15, it will return week number 3.


    Can someone tell me how to do it? Thanks a lot.
    Last edited by jackson_hollon; 12-12-2014 at 03:13 AM.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    =int((a1-date(year(a1),1,1))/7)+1
    Last edited by samba_ravi; 12-10-2014 at 05:28 AM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    Attach sample file

  4. #4
    Registered User
    Join Date
    06-11-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    If it has to take monday as the first day of every week,use this=DATE(YEAR(A1),MONTH(A1),DAY(A1)-WEEKDAY(A1,3)).

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    Just use 2018 as the default year as 01/01/2018 will be a Monday

    =WEEKNUM(DATE(2018,MONTH(A1),DAY(A1)))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

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

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    Quote Originally Posted by Special-K View Post
    Just use 2018 as the default year as 01/01/2018 will be a Monday

    =WEEKNUM(DATE(2018,MONTH(A1),DAY(A1)))
    It's a nice idea but I don't think that will work, firstly WEEKNUM defaults to a Sunday start, so you either need to find a year which starts with a Sunday or use 2 as the second argument of WEEKNUM.........but even then leap years will mess you up so I'd endorse nflsales proposed solution which should work for any date in any year

    (of course you always end up with the last day, or two days in leap years being in week 53)
    Audere est facere

  7. #7
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: Creating week number starting on Jan 1 to Jan 7 as week one

    nflsales, Md Aejaz, Special-K and Audere,

    Thank you very much for the help!

    Jackson

+ 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. Starting Week number by specific time
    By naiconn in forum Excel General
    Replies: 5
    Last Post: 12-03-2014, 08:37 AM
  2. [SOLVED] Format a cell to display week number starting from a certain date
    By avolkmar in forum Excel General
    Replies: 3
    Last Post: 09-23-2014, 02:34 PM
  3. Convert date to week number for fiscal year starting July 25
    By ARayburn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-15-2013, 10:07 AM
  4. Replies: 7
    Last Post: 05-02-2013, 06:48 AM
  5. Replies: 0
    Last Post: 01-21-2013, 08:46 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