![]() |
How to display weeknumber with year code
I can display weeknumber but I need in front year code in 2 cifers.
Does anyone knows easy solution? |
How to display weeknumber with year code
=TEXT(A1,"yy")&TEXT(weeknum(A1),"00")
-- HTH RP (remove nothere from the email address if mailing direct) "Lubo" wrote in message ... I can display weeknumber but I need in front year code in 2 cifers. Does anyone knows easy solution? |
How to display weeknumber with year code
On Tue, 8 Nov 2005 03:50:15 -0800, "Lubo"
wrote: I can display weeknumber but I need in front year code in 2 cifers. Does anyone knows easy solution? =TEXT(date,"yy")&TEXT(weeknum(date),"00") will display a two digit year followed by a two digit weeknumber. Note that the Excel Weeknum function uses "Excel's definition" of weeknumber which is not the ISO standard. If you want to use the ISO standard weeknumber, you'll need a VBA User Defined Function or a complicate worksheet function. The VBA code for ISO weeknum: -------------------- Function ISOWeeknum(dt As Date) As Integer ISOWeeknum = DatePart("ww", dt, vbMonday, vbFirstFourDays) If ISOWeeknum 52 Then If DatePart("ww", dt + 7, vbMonday, vbFirstFourDays) = 2 Then ISOWeeknum = 1 End If End If End Function --------------------- --ron |
All times are GMT +1. The time now is 11:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com