+ Reply to Thread
Results 1 to 7 of 7

PowerQuery: WEEKNUM(CELL, 16) Equivalent?

  1. #1
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    Hey all - happy Tuesday!

    I am trying to get WEEKNUM based on Sat-Fri weeks in PowerQuery. Every time I think I have it I notice one year is right and another is not.

    What's the proper way to get WEEKNUM with the week starting on Sat?

    Here's my existing (non working) try:

    Please Login or Register  to view this content.
    Thanks in advance

    UPDATE: Added simplified sample file with only the date and added weeknum column in question.
    Attached Files Attached Files
    Last edited by NewYears1978; 11-21-2023 at 12:48 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,914

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    Where is the workbook?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    It's 500mb and full of sensitive data. Difficult to make a sample file because it's pulling from network files. Didn't think example file helped here really but I will see if I can make a stripped down sample with just the date and nothing else.

    Added sample to OP - Thanks!
    Last edited by NewYears1978; 11-21-2023 at 12:49 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,935

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    Add Column
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    Yessss that work, I was close but just slightly off. Thank you alansidman =D

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,935

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    Glad to have helped. Thanks for the Rep

  7. #7
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: PowerQuery: WEEKNUM(CELL, 16) Equivalent?

    But Date.WeekOfYear is not always correct unfortunately. This custom function outputs the ISO Weeknum.
    Put this in a blank Query and name it "ISO_WeekNum"

    Please Login or Register  to view this content.

    And then write the add column line like this

    Please Login or Register  to view this content.

+ 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. [SOLVED] PowerQuery IF cell Value
    By Undo in forum Excel General
    Replies: 3
    Last Post: 08-27-2023, 02:50 AM
  2. [SOLVED] Wrap conetnt within cell in Powerquery
    By Akcena007 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-24-2023, 07:12 AM
  3. pass cell value as parameter into Powerquery
    By KOKOSEK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2021, 05:30 AM
  4. [SOLVED] PowerQuery reference cell value
    By Imbizile in forum Excel General
    Replies: 3
    Last Post: 03-17-2019, 09:00 AM
  5. cell loses #REF with PowerQuery (Get & Transform)
    By sick stigma in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-16-2018, 09:57 AM
  6. Replies: 4
    Last Post: 11-25-2015, 06:44 PM
  7. empty cell, weeknum
    By randalino in forum Excel General
    Replies: 1
    Last Post: 05-26-2009, 10:12 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