How to get monthname from a weeknumber

santnok

Board Regular
Joined
Jan 10, 2014
Messages
94
Hi, I have a table where a have one column with numbers from 1 - 53. This starts in B10. In C10 I want the monthname based on the weeknumber.
Numbers that are in colum B is just a plain general number. So what I like to do is in the Monthname column I want to show the monthname only one time. So if weeknumbers from
1 to 4 is January I like to show January only in week 1, so in week 5 I like to then show February. If a weeknumber go from one moth to another month, I like to show both monthname in that week.
Ex: in week 13 this year we go from March to April, I then like to show Mar/Apr in the C column.

Can someone help me out on how to write the code in Column C to make this happen?

The table I have looks like this to day, under this tabel I have created I tabel that show how I want i to look. :)

Row
B
C
9WeeknumberMonthname
101JAN
112JAN
123JAN
134JAN
145JAN
156FEB
167FEB
178FEB
189FEB
1910MAR
2011MAR
2112MAR
2213MAR
2314APR
2415APR
2516APR
2617APR
2718APR
2819MAI
2920MAI
3021MAI
3122MAI
3223JUN
3324JUN
3425JUN
3526JUN
3627JUL
3728JUL
3829JUL
3930JUL
4031JUL
4132AUG
4233AUG
4334AUG
4435AUG
4536SEP
4637SEP
4738SEP
4839SEP
4940SEP
5041OKT
5142OKT
5243OKT
5344OKT
5445NOV
5546NOV
5647NOV
5748NOV
5849DES
5950DES
6051DES
6152DES
6253DES

Like it to look like this, I have taken the calendar year for 2021, so this tabel is the real one :)

RowBC
9WeeknumberMonthname
101JAN
112
123
134
145FEB
156
167
178
189Mar
1910
2011
2112
2213Mar/Apr
2314
2415
2516
2617Apr/Mai
2718
2819
2920
3021
3122Mai/Jun
3223
3324
3425
3526Jun/Jul
3627
3728
3829
3930Jul/Aug
4031
4132
4233
4334
4435Aug/Sep
4536
4637
4738
4839Sep/Oct
4940
5041
5142
5243
5344Nov
5445
5546
5647
5748Nov/Des
5849
5950
6051
6152Des/ Jan 2022
6253

Please get some help on how to write this code :)
Thanks for all help and answers :)
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,988
Office Version
  1. 2016
Platform
  1. Windows
That's a good website run by Mynda Tracy and her husband I believe. I use it more for PowerQuery with Mr Excel my preference for purely excel related issues. Don't know why, just seems to work that way.

Glad I could help.

All the best.
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,822
Members
415,859
Latest member
Vain

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
Top