Sometimes we need to aggregate data by week and the Excel function - WEEKNUM works like a charm. But there are situations where we have data referring to diferent years and in these situations we have to associate the week number to the respective year.
For these situations we can combine WEEKUM and TEXT Excel functions. The formula would be as follows:
=TEXT(A1,"yy")&TEXT(WEEKNUM(A1),"00")
How to display the week number and year code, step by step:
- Enter 01-01-2014 on cell A1 (date from which will be retrieved the week number and year code)
- Enter the above formula in cell B2
- Press Enter
- B2 should now contain the value - 1401 - the first two digits "14" refers to year 2014, and the last two "01" refer to week number of date 01-01-2014
Examples:
Now you can play arround with the formula to retrieve year code and week number in the sequence you need.
No comments:
Post a Comment