#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Problem with formula

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Problem with formula

Hi Noel,

< I get 2006_w53

I think you get 2007_w53.

For week numbers, visit

http://www.rondebruin.nl/weeknumber.htm


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Nleric" wrote in message ...
| Hi,
| I am using Excel 2003 and am using this formula for converting dates
| (21/07/2003)
| to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
| I get 2006_w53, can some have a look at the formula and correct it?
| =YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")
|
| Regards,
| Noel LAckey.
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Problem with formula

Hi,

The answer your getting depends on what you have in cell M2. For 1/1/07 it
will correctly return week 53 and for 2/1/07 it rolls over to week 1.

Mike

"Nleric" wrote:

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Problem with formula

Hi,
thanks for your reply, I got 2006_w53 also but was expecting 2007_w01,
Regards,
Noel

"Nleric" wrote:

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Problem with formula

Hi,
I am confused, 1/1/07 was a Monday and surely it should give 2007_w01 for
this?
Noel

"Mike" wrote:

Hi,

The answer your getting depends on what you have in cell M2. For 1/1/07 it
will correctly return week 53 and for 2/1/07 it rolls over to week 1.

Mike

"Nleric" wrote:

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Problem with formula

No. Read the link I posted.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Nleric" wrote in message ...
| Hi,
| I am confused, 1/1/07 was a Monday and surely it should give 2007_w01 for
| this?
| Noel
|
| "Mike" wrote:
|
| Hi,
|
| The answer your getting depends on what you have in cell M2. For 1/1/07 it
| will correctly return week 53 and for 2/1/07 it rolls over to week 1.
|
| Mike
|
| "Nleric" wrote:
|
| Hi,
| I am using Excel 2003 and am using this formula for converting dates
| (21/07/2003)
| to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
| I get 2006_w53, can some have a look at the formula and correct it?
| =YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")
|
| Regards,
| Noel LAckey.
|


  #7   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default Problem with formula

If M2 contains 1/1/07, then WEEKNUM(M2-1) will return the week number for
12/31/06, which is 53. Why are you subtracting 1 from the date?

Tom

"Nleric" wrote:

Hi,
thanks for your reply, I got 2006_w53 also but was expecting 2007_w01,
Regards,
Noel

"Nleric" wrote:

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Problem with formula

Thanks for your help
Regards,
Noel

"Tom" wrote:

If M2 contains 1/1/07, then WEEKNUM(M2-1) will return the week number for
12/31/06, which is 53. Why are you subtracting 1 from the date?

Tom

"Nleric" wrote:

Hi,
thanks for your reply, I got 2006_w53 also but was expecting 2007_w01,
Regards,
Noel

"Nleric" wrote:

Hi,
I am using Excel 2003 and am using this formula for converting dates
(21/07/2003)
to the following format 2003_w30. But for 2007 instead of giving me 2007_w01
I get 2006_w53, can some have a look at the formula and correct it?
=YEAR(M2)&TEXT(WEEKNUM(M2-1),"""_w""00")

Regards,
Noel LAckey.

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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Is it possible? DakotaNJ Excel Worksheet Functions 25 September 18th 06 09:30 PM
formula percentage problem thinkpic New Users to Excel 4 November 2nd 05 08:04 PM
formula problem Bart New Users to Excel 4 October 21st 05 12:56 PM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM


All times are GMT +1. The time now is 12:35 PM.

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

About Us

"It's about Microsoft Excel"