Week Number and Year from Date

tandkb

Board Regular
Joined
Dec 29, 2010
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am needing Week Number and Year from the date. I have been using this formula. =TEXT(WEEKNUM(AH2,21),"00") & TEXT(AH2, "-yyyy") and it works quite well. Our Weeks run Monday Through Sunday. The problem I am having is when I get to that date 12/30/19 the Week is 1 which is correct but the year is 2019 which is not correct. The week ends on 1/5/2020 so it should be Week 1 2020 not Week 1 2019. Anyone have any ideas on this? I know this has been talked about a ton but cant find any exact fix for this senario. Thanks in advance!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
One way is
Excel Formula:
=TEXT(WEEKNUM(AH2,21),"00")&TEXT(AH2, "-yyyy")-(AND(MONTH(AH2)=12,WEEKNUM(AH2,21)=1))
Also please update your account details to show your version of Excel, as this affects which functions you can use.
 
Upvote 0
One way is
Excel Formula:
=TEXT(WEEKNUM(AH2,21),"00")&TEXT(AH2, "-yyyy")-(AND(MONTH(AH2)=12,WEEKNUM(AH2,21)=1))
Also please update your account details to show your version of Excel, as this affects which functions you can use.
This worked perfectly! Thanks so much!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top