+ Reply to Thread
Results 1 to 39 of 39

Convert a WEEKNUM formula to work in 2003 Excel

  1. #1
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Convert a WEEKNUM formula to work in 2003 Excel

    Hi guys,
    Is there anyway to convert this so it’s compatable in 2003 excel?

    =IF(WEEKNUM(AK7)=WEEKNUM(AK8),AM7,AM7 +1)

    Thanks
    Last edited by AliGW; 10-19-2017 at 05:53 AM.

  2. #2
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    BBUMP, Anyone?

  3. #3
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Lee - please do not bump threads until a day has passed.

    Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. If you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

    From the forum rules (link in the main menu above):
    • If your question has not been answered within a day, consider adding another post with any additional information you believe is relevant. If you think your post is good as is, just reply to your own thread with the words "Bump no response", which will bring it to the top of the forum.
    Last edited by AliGW; 10-19-2017 at 08:01 AM.
    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.

  4. #4
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Oh right sorry, my bad!
    Last edited by AliGW; 10-19-2017 at 08:01 AM. Reason: Unnecessary quotation removed.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Try

    To use WEEKNUM you need to install the Analysis ToolPak from Tools > Add-Ins.

  6. #6
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by JohnTopley View Post
    Try

    To use WEEKNUM you need to install the Analysis ToolPak from Tools > Add-Ins.
    I never had it before on other workbook, and it works it’s just need it on 2003 excel, can the formula not just be changed? Or..

  7. #7
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Can’t seem to install it on work computer because of the security, is there anyway round using them WEEKNUM?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Assuming 1st Jan is (first day of) week1 then

    =INT((A1-EOMONTH($A$1,-1)-1)/7)+1

    A1=01/01/year

    will calculate a week number

    It will need to be "re-set" for 1st Jan following year

    Does this help?

  9. #9
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    1st day of the week is Sunday, 2nd is Monday.. 1-7 Sunday to Saturday
    Last edited by AliGW; 10-19-2017 at 01:11 PM. Reason: Quotation removed - not needed.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    ..so first Sunday in January is start of week 1 ?

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    1st Jan 2017 is a Sunday! (by luck!).

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

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Do you actually want to replicate WEEKNUM function exactly or have every week starting on a Sunday? Those two are not the same because WEEKNUM defines week 1 as starting on 1st Jan, whatever the day of week, with week 2 starting on the next Sunday ( so week 1 could be as short as 1 day)

    if it's the latter then you don't need WEEKNUM function at all - just use this formula:

    =AM7+(AK7-WEEKDAY(AK7-1)<>AK8-WEEKDAY(AK8-1))
    Audere est facere

  13. #13
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Here, I googled it for you:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    https://msdn.microsoft.com/en-us/lib...ffice.12).aspx
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  14. #14
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by JohnTopley View Post
    1st Jan 2017 is a Sunday! (by luck!).
    What is A1 though? 🤔 It’s hard to explain what I need

  15. #15
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by daddylonglegs View Post
    Do you actually want to replicate WEEKNUM function exactly or have every week starting on a Sunday? Those two are not the same because WEEKNUM defines week 1 as starting on 1st Jan, whatever the day of week, with week 2 starting on the next Sunday ( so week 1 could be as short as 1 day)

    if it's the latter then you don't need WEEKNUM function at all - just use this formula:

    =AM7+(AK7-WEEKDAY(AK7-1)<>AK8-WEEKDAY(AK8-1))
    I need every week starting on a Sunday, basically need to replicate WEEKNUM.. as it works perfectly on excel 2007 my comp but at work it doesn’t as it’s 2003

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

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Like I said, though, those are not the same - using WEEKNUM function means that every year 1st Jan and the day before (31st Dec) will be deemed to be in different weeks, even if 31 Dec is a Wednesday, for example, and 1st Jan a Thursday. If you want those two days to be counted as the same week in your formula then you can use the formula I suggested
    Last edited by AliGW; 10-19-2017 at 01:10 PM. Reason: Quotation removed - not needed.

  17. #17
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    =AM7+(AK7-WEEKDAY(AK7-1)<>AK8-WEEKDAY(AK8-1))

    Is just returning #NUM! Though?
    Last edited by AliGW; 10-19-2017 at 01:09 PM. Reason: Quotation removed - not needed.

  18. #18
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by daddylonglegs View Post
    Like I said, though, those are not the same - using WEEKNUM function means that every year 1st Jan and the day before (31st Dec) will be deemed to be in different weeks, even if 31 Dec is a Wednesday, for example, and 1st Jan a Thursday. If you want those two days to be counted as the same week in your formula then you can use the formula I suggested
    Right when I get home, I’ll send you the workbook to have a look

  19. #19
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Lee - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

  20. #20
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Oh right, sorry ali.. breaking so many rules today haha!


    File seems to be a little big so will link through Dropbox

    https://www.dropbox.com/s/l1y94vh2h4...LIDAY.xls?dl=0

    The formula needed is on overview in column AM8:AM150 , The previous formula is currently there showing how i need it to work, thanks

  21. #21
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Tried it, not showing the first week on the left side sadly, where it shows all the holidays as you could see
    Last edited by LeeBillington; 10-19-2017 at 01:53 PM.

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

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    OK, try this formula in AM8 copied down

    =AM7+IF(COUNT(AK7,AK8)=1,1,(AK7-WEEKDAY(AK7-1)<>AK8-WEEKDAY(AK8-1)))

  23. #23
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    It worked!! will that work on 2003 for sure though? as I am now trying it on 2007 and its working but you experts know whether it will work or not.

    If so! you my friend are a legend!

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

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Quote Originally Posted by LeeBillington View Post
    It worked!! will that work on 2003 for sure though?
    Yep, WEEKDAY and COUNT will work fine in 2003

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

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Quote Originally Posted by Jacc View Post
    Here, I googled it for you:

    =1+INT((B4-(DATE(YEAR(B4),1,2)-WEEKDAY(DATE(YEAR(B4),1,1))))/7)]
    Hey Jacc, when I googled it I got a shorter version!

  26. #26
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Well I'll be darned!

  27. #27
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    So I’m kinda having a problem with the formula, as it’s putting 01/04/17 a Saturday and 02/04/17 a Sunday on the same row when they should be separate as it’s two different weeks, Sunday should be on one week as it’s the new week and Saturday should be on the previous row as it’s a Saturday before that week, it’s giving the Saturday nd Sunday both week 1, also when I put 01/04/17 , 02/04/17 and 03/04/17 it’s Sunday Monday Tuesday but Monday and Tuesday go onto a different row
    Last edited by LeeBillington; 10-20-2017 at 05:45 AM.

  28. #28
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    I suggest you post a sample file.

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  29. #29
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    content deleted by poster.
    Last edited by LeeBillington; 10-21-2017 at 05:59 AM.

  30. #30
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Lee - attach the files here, please.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  31. #31
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Both failing , the workbooks are too big i believe.

  32. #32
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Then make them smaller! You only need samples that show the issues. Nobody should have to download massive workbooks in order to help you!

  33. #33
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    And how do i do that? there is no unneeded stuff within the workbook..

  34. #34
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Lee - make a smaller version of the real thing. A SAMPLE workbook. A few lines of relevant data will be enough.

  35. #35
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    That wont show what i need tho.. no one seemed to have a problem with downloading the last one anyway?

  36. #36
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,466

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    As you wish. Some people are unable to access file-sharing sites, and some will not download massive files. Your choice. You can easily show what you need to show without sending the entire dataset.

  37. #37
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Try "ZIPPING" the file which allows much larger files to be posted.

    However, you should, as already pointed out by Ali, be able to send a sample file as we are apparently only interested in relatively "simple" date-related formula.

  38. #38
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    So I've attached the way its coming up, and the way i kinda need it

    the formula is still in AM8 downwards on overview sheet

    but the place its coming out wrong is I9:V12

    The correct way. displaying how i need it with the old formula

    The Incorrect way. displaying how its coming up with the new one.

    You'll see the difference in results on both pages

    thanks
    Attached Files Attached Files

  39. #39
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Convert a WEEKNUM formula to work in 2003 Excel

    Is your logic for "Right" correct: add 2 May as a holiday and it says this is week 3? Is the logic only showing dates in a "different" week as opposed the actual "weeknum" week?

    The logic only works if the days are sequential with no gaps ?

    Put =WEEKNUM(AK8) in AN8 and copy down , adding holiday date of 2 May.
    Last edited by JohnTopley; 10-22-2017 at 04:24 AM.

+ 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. Saving 2003 macros using excel 2013 now unusable on Excel 2003
    By Bukovnik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2014, 07:09 PM
  2. Excel 2003 to Excel 2010 and back to Excel 2003 problem
    By keops9876 in forum Excel General
    Replies: 1
    Last Post: 02-02-2013, 07:30 PM
  3. Excel 2007 to 2003 VBA Compatability - Modifying Coding to comply with 2003 Interface
    By bsykora23 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2011, 12:47 PM
  4. Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message
    By ITAnnaJones@gmail.com in forum Excel General
    Replies: 0
    Last Post: 07-10-2006, 10:09 AM
  5. Excel 2003 workbook saved as Excel 97 - 2003 issue
    By Jeff M in forum Excel General
    Replies: 0
    Last Post: 03-22-2006, 04:30 PM
  6. Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200
    By Joel Berry in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-06-2006, 06:25 PM
  7. Replies: 1
    Last Post: 01-22-2006, 01:20 PM

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