Sequence of week number by month/date

jl2509

Board Regular
Joined
Oct 30, 2015
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I have Months listed across a row starting in C3 with Jan, then F3 with Feb etc all at the same 2 column intervals (other data in between)
In cell C1 is the year "2023"
Is there a way to have a sequence of week numbers generated from the month and year. i.e in Cell C3 it shows "Jan" in C1 it shows "2023" so from cell C4 it should list the week numbers for that month?

Thanks in Advance
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Apologies, I cannot install addons
I just want to be able to use sequence or array formula for the weeks of a month
 
Upvote 0
The image shows the week of a month by the year in cell C1
The reason that week 5 shows in both column C and F is because the end of Jan and start of Feb share the same week number

I know I could do this with a helper column of date and use the formula Weeknum(n) but I dont really want additional data columns.
I am assuming that combining Sequence, Weeknum, with EOMONTH is the solution but I am lost with the actual formula.

The names in columns B and E are populated by another formula

1701945491918.png
 
Upvote 0
Hi, here's one option you could try:

Book1
ABCDEFGHIJKL
12024
2
3JanFebMarApr
4Week 1Week 5Week 9Week 14
5Week 2Week 6Week 10Week 15
6Week 3Week 7Week 11Week 16
7Week 4Week 8Week 12Week 17
8Week 5Week 9Week 13Week 18
9Week 14
10
11
12
Sheet1
Cell Formulas
RangeFormula
C4:C8,L4:L8,I4:I9,F4:F8C4=LET(D,DATE($C$1,MONTH(1&C3),1),"Week "&UNIQUE(WEEKNUM(D+SEQUENCE(DAY(EOMONTH(D,0)),,0))))
Dynamic array formulas.
 
Upvote 0
Here's another option, slightly longer, but probably a little more performant.

Excel Formula:
=LET(D,DATE($C$1,MONTH(1&C3),1),FW,WEEKNUM(D),LW,WEEKNUM(EOMONTH(D,0)),"Week "&SEQUENCE(LW-FW+1,,FW,1))
 
Upvote 0
Solution
FormR,
Great solution. I went with option 2.

Just a side question, using sequence how do you list the number of weeks in a year, from the Start of C1 to End of C1.
 
Upvote 0
Just a side question, using sequence how do you list the number of weeks in a year, from the Start of C1 to End of C1.
Something like this maybe:

Excel Formula:
=SEQUENCE(WEEKNUM(DATE(C1,12,31)))
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,203
Members
452,617
Latest member
Narendra Babu D

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