Hi,
I'm hoping someone might be able to help me. I have a list of records for which I'm trying to calculate year and week number for 2007-2011.
I calculated the ISO week number using the following formula:
=INT((G2-DATE(YEAR(G2-WEEKDAY(G2-1)+4),1,3)+WEEKDAY(DATE(YEAR(G2-WEEKDAY(G2-1)+4),1,3))+5)/7
I had then combined this with the year by using:
=YEAR(G3)&I3 or =YEAR(G3)&"0"&I3 (for wk no. <10) to give the format yyyyww
However the problem arises when part of December falls into Wk1 or January into Wk52/53
E.g. records dated 02/01/2011 are currently being assigned to year 2011 and week 52, when it actually should be year 2010.
It was suggested that I use an if query that stated if the date is before a certain date in January 2011 then if should be 2010. However I'm doing this for a number of years and it's going to have to be repeated so ideally I'd just like one formula that I can cut and paste onto all my spreadsheets containing data for 2007-2011 to reduce the risk of errors.
Trouble is it depends what day of the week the date falls on.
So for example is 28th December 2010 is a Monday then it would be in Wk1 of 2011, however if it’s a Saturday then it’ll be Wk52 2010 as Wk1 would start on the following Monday.
If anyone has any suggestions I'd be really grateful. I'm sure this must be an isssue others have come up against but I've been unable to find any solutions listed anywhere.
Thank you for your time on this matter
Chantil
I'm hoping someone might be able to help me. I have a list of records for which I'm trying to calculate year and week number for 2007-2011.
I calculated the ISO week number using the following formula:
=INT((G2-DATE(YEAR(G2-WEEKDAY(G2-1)+4),1,3)+WEEKDAY(DATE(YEAR(G2-WEEKDAY(G2-1)+4),1,3))+5)/7
I had then combined this with the year by using:
=YEAR(G3)&I3 or =YEAR(G3)&"0"&I3 (for wk no. <10) to give the format yyyyww
However the problem arises when part of December falls into Wk1 or January into Wk52/53
E.g. records dated 02/01/2011 are currently being assigned to year 2011 and week 52, when it actually should be year 2010.
It was suggested that I use an if query that stated if the date is before a certain date in January 2011 then if should be 2010. However I'm doing this for a number of years and it's going to have to be repeated so ideally I'd just like one formula that I can cut and paste onto all my spreadsheets containing data for 2007-2011 to reduce the risk of errors.
Trouble is it depends what day of the week the date falls on.
So for example is 28th December 2010 is a Monday then it would be in Wk1 of 2011, however if it’s a Saturday then it’ll be Wk52 2010 as Wk1 would start on the following Monday.
If anyone has any suggestions I'd be really grateful. I'm sure this must be an isssue others have come up against but I've been unable to find any solutions listed anywhere.
Thank you for your time on this matter
Chantil