Week number based on the year starting with a particular date

UmairKamal

New Member
Joined
Aug 27, 2021
Messages
17
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Dear users,

I am using MS Excel 2016 and have a dataset of nearly 650,000 rows. The financial year runs from April to March. however for this dataset, the report requires a weekly analysis. the week commences on Monday. so for example, the year 2023-24 starts with Monday, 27 March 2023 and ends at 31 March 2024 (i.e. 52 weeks).

I was using the formula

=WEEKNUM(C2-(1+DATE(YEAR(C2),3,26)-DATE(YEAR(C2),1,1)))

where the date is in Column C.

This was working fine until the date 1/1/2024.

week 40 finishes on 31/12/2023, however, the date 01/01/2024 is also being considered in week 40, whereas it should be week 41 as 01/01/2024 is a Monday.

please advise.

kind regards.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Please try this:

Book2
CDEFGH
1DateWeekNumYearYear Beg Date
21/1/20244420222/28/2022
33/15/2024320232/27/2023
42/1/20244920242/26/2024
52/25/20245220252/24/2025
620262/23/2026
7
Sheet1
Cell Formulas
RangeFormula
D2:D5D2=ROUNDUP((C2-VLOOKUP(C2,Table1[Year Beg Date],1,TRUE))/7,0)
H2:H6H2=DATE(G2,3,1)+(1-WEEKDAY(DATE(G2,3,1),2))
Named Ranges
NameRefers ToCells
TBD_Tbl=Sheet1!$G$2H2
 
Upvote 0
Sorry about the conversion from dd/mm/yyyy to US mm/dd/yyyy. You can switch that around with no issues.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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