Month/Year from Week/Year

DowReena

New Member
Joined
Feb 23, 2017
Messages
4
Is there a way to return Month/Year from a cell that contains Week/Year?

Example: A1 contains "03/2016" and would like to show "January/2016" or "01/2016"
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hello DowReena

can you try this?
Code:
ActiveCell.NumberFormat = "MMMMMMMMM/yyyy"

or

Code:
ActiveCell.NumberFormat = "mm/yyyy"

regards,
Tom
 
Last edited:
Upvote 0
Welcome to the Forum!

Is there a way to return Month/Year from a cell that contains Week/Year?

Yes, but you'll need to let us know your numbering system, e.g. ISO, or perhaps something different?

How are you determining Week 1?
 
Upvote 0
Hello DowReena

can you try this?
Code:
ActiveCell.NumberFormat = "MMMMMMMMM/yyyy"

or

Code:
ActiveCell.NumberFormat = "mm/yyyy"

regards,
Tom


Hi-sorry if this is a dumb question..but where do I input that code? Pasting that in B1 does not do anything..
 
Upvote 0
Try

=TEXT(WORKDAY.INTL(DATE(RIGHT(A1,4),1,0),LEFT(A1,2),"0111111"),"mmmm/yyyy")

That's a neat formula, if the first week always starts on the first Monday of the year.

But if DowReena is using ISO-8601 as indicated, there is the additional requirement that Week 1 must contain the first Thursday of the year. So, for example, Week 1 2015 actually starts on Monday 29 December 2014.

B1: =DATE(RIGHT(A1,4),1,-2)-WEEKDAY(DATE(RIGHT(A1,4),1,3))+7*LEFT(A1,2)
C1: =TEXT(DATE(RIGHT(A1,4),1,-2)-WEEKDAY(DATE(RIGHT(A1,4),1,3))+7*LEFT(A1,2),"mmm yyyy")

Sheet1

*ABC

<tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="align: center"]01/2015[/TD]
[TD="align: center"]Monday 29 Dec 2014[/TD]
[TD="align: center"]Dec 2014[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: center"]05/2011[/TD]
[TD="align: center"]Monday 31 Jan 2011[/TD]
[TD="align: center"]Jan 2011[/TD]

</tbody>



DowReena, ISO-8601 doesn't provide any correspondence between week number and month. Jonmo1's and my formula give you the month of the Monday. So the second example above shows as January 2011, although 6 of the 7 days actually fall into February.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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