Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lubo
 
Posts: n/a
Default 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?
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default 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?



  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
t-distribution puzzle in Excel [email protected] Excel Discussion (Misc queries) 8 November 11th 05 10:27 AM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
How can I make Excel display HTML code as text roopytoopdongle Excel Discussion (Misc queries) 1 March 20th 05 06:40 AM
Display specific rows from table on other worksheet Bruno G. Excel Discussion (Misc queries) 2 January 20th 05 11:22 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"