WeekNum relative to a specific date?

enrid98

New Member
Joined
May 1, 2007
Messages
8
Does anyone know of a way to use the WEEKNUM function but to have it display the week number relative to a specific date? For example, If my column of dates starts at May 7th, where I would like May 7th to appear as Week "1" and have it continue from that point on where May 14 (for example) would be week 2, etc.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I don't know of a way to modify the output of the WEEKNUM function. However, you could construct a formula to do this.

Two variations, assumes dates are in column A, drag formulas down to cover all rows with dates:

=WEEKNUM(A1)-WEEKNUM($A$1)+1

=WEEKNUM(A1-WEEKDAY($A$1)+1)-WEEKNUM($A$1)+1

In the first formula Sunday is always the first day of the week. In the second formula the date entered in A1 defines the first day of the week.

Rick
 
Upvote 0
This probably depends on what you want to happen after a year.....

If you have your start date in G2 then this formula will give you the weeknum for a date in A1

=INT((A1-$G$2)/7)+1

but the week numbers will just increment continually, even after a year has passed, so you can get week number 70 etc. This allows G2 to be any day.

Or if you want the number to return to 1 after a year, assuming G2 contains a Monday start date

=WEEKNUM(A1-(WEEKNUM(G$2,2)-1)*7,2)
 
Upvote 0

Forum statistics

Threads
1,215,167
Messages
6,123,401
Members
449,098
Latest member
ArturS75

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