wrong week number using Weeknum(date,x)

Zalvi

New Member
Joined
May 5, 2010
Messages
1
Hi

Using Excel 2003.
Just notise a that I got a fauly week number when using weeknum(2010-04-29,1) it return 18

I think it has to do with the preaty odd start of this year. In sweden we start counting weeks 1 in january from the week with at least 4 days in, and the wees start on Mondays, in 2010 the week number one are starting with 4th of January, in outlook it is a setting for this, how to handle it in Excel.

Zalvi
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello Zalvi, welcome to MrExcel

It sounds like you want ISO week numbers (where week 1 starts on the first Monday on or after 29th December). There's no inbuilt function for those. You can download morefunc add-in and use ISO.WEEKNUM function or use this formula

=INT((A2-WEEKDAY(A2,2)-DATE(YEAR(A2+4-WEEKDAY(A2,2)),1,4))/7)+2

where your date is in A2
 
Upvote 0
Hello barry,

I was pleasantly surprised when I found in Excel 2010 that
Code:
WEEKNUM(serial_number, return_type)
function is compatible with the Gregorian Calendar now.

Reading Excel 2010 help about WEEKNUM function:
System 2: The week containing the first Thursday of the year is the first week of the year, and is numbered as 1 week. This system is specified in the ISO 8601, which is commonly known as the European week numbering system.

And this is achieved with a value of return_type = 21 for all countries following the Gregorian Calendar and ISO 8601 standard.

It is a pity that this return_type was not included before in versions prior to Excel 2010.

In the 2010 Beta version I'm trying, do not show the type 21 when I'm writing the WEEKNUM() function, only types 1, 2 and 11 to 17 are showed. Could Microsoft fix it?

@Zalvi if argument has a value of 1 or omitted Week begins on Sunday.

In Excel 2003 and 2007, the WEEKNUM function considers the week containing January 1 to be the first week of the year. However, there is a European standard that defines the first week as the one with the majority of days (four or more) falling in the new year. This means that for years in which there are three days or less in the first week of January, the WEEKNUM function returns week numbers that are incorrect according to the European standard.

In Excel 2010, use one of these formulas:
Code:
=WEEKNUM(A1,21)
=WEEKNUM(DATE(2010,4,29),21)
(A1 is a date format cell)

MS Excel remember us that dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2010,5,23) for the 23rd day of May, 2010. Problems can occur if dates are entered as text.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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