Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default WEEKNUM Question

Hi,

In my company, 2004 has 53 weeks so Week 1 of 2005 is January 2nd.

I am trying to create a formula that checks the last number of the year like
so (D( is a date in the form of 1/1/2005):
=IF((RIGHT(D9)=5),(WEEKNUM(D9,1)-1),WEEKNUM(D9,1))

But the problem is, RIGHT(D9) gives me a 0???

Any ideas??

Thank you in advance.

Rusty


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default WEEKNUM Question

Hi
you can't use text functions on a date value
try
=IF(RIGHT(TEXT(D9,"YYYY"),1)="5",WEEKNUM(D9,1)-1,WEEKNUM(D9,1))


--
Regards
Frank Kabel
Frankfurt, Germany

"RustyR" schrieb im Newsbeitrag
...
Hi,

In my company, 2004 has 53 weeks so Week 1 of 2005 is January 2nd.

I am trying to create a formula that checks the last number of the

year like
so (D( is a date in the form of 1/1/2005):
=IF((RIGHT(D9)=5),(WEEKNUM(D9,1)-1),WEEKNUM(D9,1))

But the problem is, RIGHT(D9) gives me a 0???

Any ideas??

Thank you in advance.

Rusty



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default WEEKNUM Question

Hi,

Use this formula...It converts the year in D9 to text then takes the
right character, the five.
=RIGHT(TEXT(D9,"YYYY"),1)
Hope it helps.
Eloy

"RustyR" wrote:

Hi,

In my company, 2004 has 53 weeks so Week 1 of 2005 is January 2nd.

I am trying to create a formula that checks the last number of the year like
so (D( is a date in the form of 1/1/2005):
=IF((RIGHT(D9)=5),(WEEKNUM(D9,1)-1),WEEKNUM(D9,1))

But the problem is, RIGHT(D9) gives me a 0???

Any ideas??

Thank you in advance.

Rusty



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default WEEKNUM Question

On Fri, 22 Oct 2004, Eloy wrote:

Use this formula...It converts the year in D9 to text then takes the
right character, the five.
=RIGHT(TEXT(D9,"YYYY"),1)


That would work, but not the way I would do it. I'd use:
=MOD(YEAR(D9),10)

Don <donwiss at panix.com.
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
WEEKNUM() Question Jared Call Excel Worksheet Functions 3 October 25th 06 03:14 PM
weeknum gone ?? KrunoG Excel Worksheet Functions 2 June 27th 06 10:11 AM
Weeknum Mike D. Excel Worksheet Functions 4 February 14th 06 08:44 PM
WEEKNUM() Ciara Excel Discussion (Misc queries) 5 April 13th 05 12:09 PM
WeekNum ISO RPitoyo Excel Worksheet Functions 4 December 20th 04 06:24 PM


All times are GMT +1. The time now is 11:33 AM.

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"